~andrewjbeach/juju-ci-tools/make-local-patcher

« back to all changes in this revision

Viewing changes to jujuconfig.py

  • Committer: Aaron Bentley
  • Date: 2015-08-19 15:07:08 UTC
  • mto: This revision was merged to the branch mainline in revision 1069.
  • Revision ID: aaron.bentley@canonical.com-20150819150708-88xesx4iardg12b4
Wait for proc to exit after signalling.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
 
83
83
def translate_to_env(current_env):
84
84
    """Translate openstack settings to environment variables."""
85
 
    if current_env['type'] not in ('openstack', 'rackspace'):
 
85
    if current_env['type'] != 'openstack':
86
86
        raise Exception('Not an openstack environment. (type: %s)' %
87
87
                        current_env['type'])
88
88
    # Region doesn't follow the mapping for other vars.
98
98
    new_environ = {
99
99
        'EC2_URL': 'https://%s.ec2.amazonaws.com' % current_env['region']}
100
100
    for key in ['access-key', 'secret-key']:
101
 
        env_key = key.upper().replace('-', '_')
102
 
        new_environ['EC2_' + env_key] = current_env[key]
103
 
        new_environ['AWS_' + env_key] = current_env[key]
 
101
        new_environ['EC2_' + key.upper().replace('-', '_')] = current_env[key]
104
102
    return new_environ
105
103
 
106
104
 
126
124
            'lxc': 'LXC (local)'
127
125
        }[config.get('container', 'lxc')]
128
126
    elif config['type'] == 'openstack':
129
 
        if config['auth-url'] == (
 
127
        if config['auth-url'].endswith('hpcloudsvc.com:35357/v2.0/'):
 
128
            return 'HPCloud'
 
129
        elif config['auth-url'] == (
130
130
                'https://keystone.canonistack.canonical.com:443/v2.0/'):
131
131
            return 'Canonistack'
132
132
        else:
134
134
    try:
135
135
        return {
136
136
            'ec2': 'AWS',
137
 
            'rackspace': 'Rackspace',
138
137
            'joyent': 'Joyent',
139
138
            'azure': 'Azure',
140
139
            'maas': 'MAAS',