def __call__(self, behavior=None): # if behavior not in behavior_apis: # raise CommandError('Unknown behavior.') bus.queryenv_service = new_queryenv() api = ServiceAPI() # api.init_service() if behavior and behavior not in behavior_apis: raise CommandError('Unknown behavior.') if behavior: print "Reconfiguring behavior %s..." % behavior else: print "Reconfiguring..." behavior_params = {behavior: None} if behavior else None try: api.reconfigure(behavior_params=behavior_params, async=False) except (BaseException, Exception), e: raise CommandError('Reconfigure failed.\n%s' % e)
def queryenv(cls): if not hasattr(cls, '_queryenv'): cls._queryenv = new_queryenv() return cls._queryenv