From da74c0baceb812b6dec7a7f18b0612dcfbab77af Mon Sep 17 00:00:00 2001 From: Thayne Harbaugh Date: Wed, 21 Oct 2015 15:03:50 -0600 Subject: [PATCH] philips_hue fails during unit tests. It appears that it cannot index 'proxymodule' and doesn't properly handle the exception. This may not be the best way, but it will properly skip initialization if settings are unavailable. --- salt/modules/philips_hue.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/salt/modules/philips_hue.py b/salt/modules/philips_hue.py index 637fb3eabc..f5a114579d 100644 --- a/salt/modules/philips_hue.py +++ b/salt/modules/philips_hue.py @@ -29,7 +29,7 @@ def _proxy(): ''' Get proxy. ''' - return __opts__['proxymodule'] + return __opts__.get('proxymodule') def __virtual__(): @@ -37,6 +37,9 @@ 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)