From c676846066139095cfc3ca8317b4bb2ef2268eca Mon Sep 17 00:00:00 2001 From: Mike Place Date: Thu, 8 Dec 2016 13:01:10 -0700 Subject: [PATCH 1/4] Kill pkg_resources for CLI tools --- salt/cli/call.py | 2 ++ salt/cli/cp.py | 2 ++ salt/cli/key.py | 3 +++ salt/cli/run.py | 2 ++ salt/cli/salt.py | 3 ++- salt/cli/spm.py | 2 ++ 6 files changed, 13 insertions(+), 1 deletion(-) diff --git a/salt/cli/call.py b/salt/cli/call.py index b7cc235deb5b..4712e731d84f 100644 --- a/salt/cli/call.py +++ b/salt/cli/call.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import +import sys +sys.modules['pkg_resources'] = None import os from salt.utils import parsers diff --git a/salt/cli/cp.py b/salt/cli/cp.py index 601c17461e21..63d35fec71fe 100644 --- a/salt/cli/cp.py +++ b/salt/cli/cp.py @@ -9,6 +9,8 @@ # Import python libs from __future__ import print_function from __future__ import absolute_import +import sys +sys.modules['pkg_resources'] = None import os import sys diff --git a/salt/cli/key.py b/salt/cli/key.py index d89c3c3b174a..990925a86978 100644 --- a/salt/cli/key.py +++ b/salt/cli/key.py @@ -1,6 +1,9 @@ # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import +import sys +sys.modules['pkg_resources'] = None + from salt.utils import parsers from salt.utils.verify import check_user, verify_log diff --git a/salt/cli/run.py b/salt/cli/run.py index cb8437999d2a..fa286c7446c8 100644 --- a/salt/cli/run.py +++ b/salt/cli/run.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import +import sys +sys.modules['pkg_resources'] = None from salt.utils import parsers from salt.utils import activate_profile diff --git a/salt/cli/salt.py b/salt/cli/salt.py index a00d8a21f996..1fc9a8350823 100644 --- a/salt/cli/salt.py +++ b/salt/cli/salt.py @@ -2,8 +2,9 @@ # Import python libs from __future__ import absolute_import, print_function -import os import sys +sys.modules['pkg_resources'] = None +import os # Import Salt libs from salt.ext.six import string_types diff --git a/salt/cli/spm.py b/salt/cli/spm.py index 3d347c80a8df..a7e8fc72c697 100644 --- a/salt/cli/spm.py +++ b/salt/cli/spm.py @@ -10,6 +10,8 @@ # Import Python libs from __future__ import absolute_import +import sys +sys.modules['pkg_resources'] = None # Import Salt libs import salt.spm From bb3af72317ef6dd93a7b13a4d5157315eb945c22 Mon Sep 17 00:00:00 2001 From: Mike Place Date: Fri, 9 Dec 2016 12:24:28 -0700 Subject: [PATCH 2/4] Remove from salt-call --- salt/cli/call.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/salt/cli/call.py b/salt/cli/call.py index 4712e731d84f..b7cc235deb5b 100644 --- a/salt/cli/call.py +++ b/salt/cli/call.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import -import sys -sys.modules['pkg_resources'] = None import os from salt.utils import parsers From f28e33b9b6696d4affc0ca7d0b276cdc0fafc8e3 Mon Sep 17 00:00:00 2001 From: Mike Place Date: Thu, 22 Dec 2016 12:44:50 -0700 Subject: [PATCH 3/4] Remove from all but salt cli --- salt/cli/cp.py | 2 -- salt/cli/key.py | 2 -- salt/cli/run.py | 2 -- salt/cli/spm.py | 2 -- salt/client/__init__.py | 2 +- 5 files changed, 1 insertion(+), 9 deletions(-) diff --git a/salt/cli/cp.py b/salt/cli/cp.py index 63d35fec71fe..601c17461e21 100644 --- a/salt/cli/cp.py +++ b/salt/cli/cp.py @@ -9,8 +9,6 @@ # Import python libs from __future__ import print_function from __future__ import absolute_import -import sys -sys.modules['pkg_resources'] = None import os import sys diff --git a/salt/cli/key.py b/salt/cli/key.py index 990925a86978..1454a2b43c48 100644 --- a/salt/cli/key.py +++ b/salt/cli/key.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import -import sys -sys.modules['pkg_resources'] = None from salt.utils import parsers diff --git a/salt/cli/run.py b/salt/cli/run.py index fa286c7446c8..cb8437999d2a 100644 --- a/salt/cli/run.py +++ b/salt/cli/run.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import -import sys -sys.modules['pkg_resources'] = None from salt.utils import parsers from salt.utils import activate_profile diff --git a/salt/cli/spm.py b/salt/cli/spm.py index a7e8fc72c697..3d347c80a8df 100644 --- a/salt/cli/spm.py +++ b/salt/cli/spm.py @@ -10,8 +10,6 @@ # Import Python libs from __future__ import absolute_import -import sys -sys.modules['pkg_resources'] = None # Import Salt libs import salt.spm diff --git a/salt/client/__init__.py b/salt/client/__init__.py index 796d1eaaaef4..50c9dee594ca 100644 --- a/salt/client/__init__.py +++ b/salt/client/__init__.py @@ -31,7 +31,7 @@ import salt.cache import salt.payload import salt.transport -import salt.loader +#import salt.loader import salt.utils import salt.utils.args import salt.utils.event From ec6901720a2453ac7b84acf36f274dab6b18ad63 Mon Sep 17 00:00:00 2001 From: Mike Place Date: Thu, 22 Dec 2016 13:04:36 -0700 Subject: [PATCH 4/4] Remove debugging --- salt/client/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/client/__init__.py b/salt/client/__init__.py index 50c9dee594ca..796d1eaaaef4 100644 --- a/salt/client/__init__.py +++ b/salt/client/__init__.py @@ -31,7 +31,7 @@ import salt.cache import salt.payload import salt.transport -#import salt.loader +import salt.loader import salt.utils import salt.utils.args import salt.utils.event