def LoadEnvVars()

in container_agent/run_containers.py [0:0]


def LoadEnvVars(env_spec, ctr_name):
    """Process an "env" block of config and return a list of env vars."""

    # TODO(thockin): could be a dict of key -> value
    all_env_vars = []
    for env_index, env_spec in enumerate(env_spec):
        if 'key' not in env_spec:
            raise ConfigException('containers[%s].env[%d] has no key'
                                  % (ctr_name, env_index))
        env_key = env_spec['key']
        if not IsCToken(env_key):
            raise ConfigException('containers[%s].env[%d].key is invalid: %s'
                                  % (ctr_name, env_index, env_key))

        if 'value' not in env_spec:
            raise ConfigException('containers[%s].env[%s] has no value'
                                  % (ctr_name, env_key))
        env_val = env_spec['value']

        all_env_vars.append('%s=%s' % (env_key, env_val))

    return all_env_vars