Merge pull request #47401 from gtmanfred/proxy

fix proxy virtual checks for marathon and fx2
This commit is contained in:
Nicole Thomas 2018-04-30 14:44:45 -04:00 committed by GitHub
commit 3bb00cbb55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View file

@ -24,11 +24,8 @@ GRAINS_CACHE = {}
def __virtual__():
try:
if salt.utils.platform.is_proxy() and __opts__['proxy']['proxytype'] == 'fx2':
return __virtualname__
except KeyError:
pass
if salt.utils.platform.is_proxy() and 'proxy' in __opts__ and __opts__['proxy'].get('proxytype') == 'fx2':
return __virtualname__
return False

View file

@ -14,10 +14,9 @@ __virtualname__ = 'marathon'
def __virtual__():
if not salt.utils.platform.is_proxy() or 'proxy' not in __opts__:
return False
else:
if salt.utils.platform.is_proxy() and 'proxy' in __opts__ and __opts__['proxy'].get('proxytype') == 'marathon':
return __virtualname__
return False
def kernel():