summaryrefslogtreecommitdiff
path: root/sysutils/py-salt/files
diff options
context:
space:
mode:
authorWen Heping <wen@FreeBSD.org>2015-09-13 00:02:21 +0000
committerWen Heping <wen@FreeBSD.org>2015-09-13 00:02:21 +0000
commit557ed71da85d3cc0af7275aa553a7fca6259e2bd (patch)
tree708afd1bf03fb0f93cae9bca739983b14f7a1242 /sysutils/py-salt/files
parent- Update to 0.32 (diff)
- Update to 2015.8.0
PR: 203047 Submitted by: christer.edwards@gmail.com(maintainer)
Notes
Notes: svn path=/head/; revision=396791
Diffstat (limited to 'sysutils/py-salt/files')
-rw-r--r--sysutils/py-salt/files/patch-salt__utils____init__.py95
1 files changed, 80 insertions, 15 deletions
diff --git a/sysutils/py-salt/files/patch-salt__utils____init__.py b/sysutils/py-salt/files/patch-salt__utils____init__.py
index fc9561be3b2a..45deec9ac3ce 100644
--- a/sysutils/py-salt/files/patch-salt__utils____init__.py
+++ b/sysutils/py-salt/files/patch-salt__utils____init__.py
@@ -1,18 +1,83 @@
---- salt/utils/__init__.py.orig 2015-04-17 18:44:50 UTC
+--- salt/utils/__init__.py.orig
+++ salt/utils/__init__.py
-@@ -372,6 +372,15 @@ def which(exe=None):
- # executable in cwd or fullpath
- return exe
+@@ -1532,20 +1532,7 @@ def is_windows():
+ '''
+ Simple function to return if a host is Windows or not
+ '''
+- import __main__ as main
+- # This is a hack. If a proxy minion is started by other
+- # means, e.g. a custom script that creates the minion objects
+- # then this will fail.
+- is_proxy = False
+- try:
+- if 'salt-proxy' in main.__file__:
+- is_proxy = True
+- except AttributeError:
+- pass
+- if is_proxy:
+- return False
+- else:
+- return sys.platform.startswith('win')
++ return sys.platform.startswith('win')
-+ p = os.environ.get('PATH')
-+ if p is not None:
-+ pp = p.split(os.pathsep)
-+ if '/usr/local/bin' not in pp:
-+ pp.append('/usr/local/bin')
-+ if '/usr/local/sbin' not in pp:
-+ pp.append('/usr/local/sbin')
-+ os.environ['PATH'] = os.pathsep.join(pp)
+
+ def sanitize_win_path_string(winpath):
+@@ -1571,15 +1558,6 @@ def is_proxy():
+ TODO: Need to extend this for proxies that might run on
+ other Unices
+ '''
+- return not (is_linux() or is_sunos() or is_windows())
+-
+-
+-@real_memoize
+-def is_linux():
+- '''
+- Simple function to return if a host is Linux or not.
+- Note for a proxy minion, we need to return something else
+- '''
+ import __main__ as main
+ # This is a hack. If a proxy minion is started by other
+ # means, e.g. a custom script that creates the minion objects
+@@ -1590,10 +1568,16 @@ def is_linux():
+ is_proxy = True
+ except AttributeError:
+ pass
+- if is_proxy:
+- return False
+- else:
+- return sys.platform.startswith('linux')
++ return is_proxy
++
+
- # default path based on busybox's default
- default_path = '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin'
- search_path = os.environ.get('PATH', default_path)
++@real_memoize
++def is_linux():
++ '''
++ Simple function to return if a host is Linux or not.
++ Note for a proxy minion, we need to return something else
++ '''
++ return sys.platform.startswith('linux')
+
+
+ @real_memoize
+@@ -1609,20 +1593,7 @@ def is_sunos():
+ '''
+ Simple function to return if host is SunOS or not
+ '''
+- import __main__ as main
+- # This is a hack. If a proxy minion is started by other
+- # means, e.g. a custom script that creates the minion objects
+- # then this will fail.
+- is_proxy = False
+- try:
+- if 'salt-proxy' in main.__file__:
+- is_proxy = True
+- except AttributeError:
+- pass
+- if is_proxy:
+- return False
+- else:
+- return sys.platform.startswith('sunos')
++ return sys.platform.startswith('sunos')
+
+
+ @real_memoize