Beispiel #1
0
    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())
Beispiel #2
0
    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())
Beispiel #3
0
    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())
Beispiel #4
0
    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())
Beispiel #5
0
    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)
Beispiel #6
0
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
Beispiel #7
0
    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