mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Backport philips_hue proxy module to 2015.8, use __proxy__ instead of opts['proxymodule']
This commit is contained in:
parent
0945d3b5b2
commit
6bdf98d2c6
1 changed files with 5 additions and 2 deletions
|
@ -29,17 +29,20 @@ def _proxy():
|
|||
'''
|
||||
Get proxy.
|
||||
'''
|
||||
return __opts__['proxymodule']
|
||||
return __proxy__
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Start the Philips HUE only for proxies.
|
||||
'''
|
||||
if not _proxy():
|
||||
return False
|
||||
|
||||
def _mkf(cmd_name, doc):
|
||||
def _cmd(*args, **kw):
|
||||
return _proxy()[_proxy().loaded_base_name + "." + cmd_name](*args, **kw)
|
||||
proxyfn = 'philips_hue.'+cmd_name
|
||||
return __proxy__[proxyfn](*args, **kw)
|
||||
return _cmd
|
||||
|
||||
import salt.proxy.philips_hue as hue
|
||||
|
|
Loading…
Add table
Reference in a new issue