def get(self, name): """Return the named environment.""" LOG.info("Fetch environment [name=%s]" % name) db_model = db_api.get_environment(name) return Environment(**db_model.to_dict())
def get(self, name): """Return the named environment.""" LOG.info("Fetch environment [name=%s]" % name) db_model = db_api.get_environment(name) return Environment.from_dict(db_model.to_dict())
def get(self, name): """Return the named environment.""" acl.enforce('environments:get', context.ctx()) LOG.info("Fetch environment [name=%s]" % name) db_model = db_api.get_environment(name) return Environment.from_dict(db_model.to_dict())
def get(self, name): """Return the named environment. :param name: Name of environment to retrieve """ acl.enforce('environments:get', context.ctx()) LOG.info("Fetch environment [name=%s]", name) db_model = db_api.get_environment(name) return resources.Environment.from_db_model(db_model)
def canonize_workflow_params(params): # Resolve environment parameter. env = params.get('env', {}) if not isinstance(env, dict) and not isinstance(env, six.string_types): raise ValueError('Unexpected type for environment [environment=%s]' % str(env)) if isinstance(env, six.string_types): env_db = db_api.get_environment(env) env = env_db.variables params['env'] = env return params
def _canonize_workflow_params(params): # Resolve environment parameter. env = params.get('env', {}) if not isinstance(env, dict) and not isinstance(env, basestring): raise ValueError( 'Unexpected type for environment [environment=%s]' % str(env) ) if isinstance(env, basestring): env_db = db_api.get_environment(env) env = env_db.variables params['env'] = env return params