2
# Copyright (c) 2015 Midokura SARL, All Rights Reserved.
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
8
# http://www.apache.org/licenses/LICENSE-2.0
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
19
RELEASES = collections.OrderedDict([
20
('icehouse/mem-1.8', {
22
'http://%s:%s@apt.midokura.com/midonet/v1.8/stable',
23
'midonet_openstack_repo':
24
'http://%s:%s@apt.midokura.com/openstack/icehouse/stable',
27
'midonet_key_fingerprint':
28
'BC4E4E90DDA81C21396081CC67B38D3A054314CD',
34
'http://%s:%s@apt.midokura.com/midonet/v1.8/stable',
35
'midonet_openstack_repo':
36
'http://%s:%s@apt.midokura.com/openstack/juno/stable',
39
'midonet_key_fingerprint':
40
'BC4E4E90DDA81C21396081CC67B38D3A054314CD',
46
'http://%s:%s@apt.midokura.com/midonet/v1.9/stable',
47
'midonet_openstack_repo':
48
'http://%s:%s@apt.midokura.com/openstack/juno/stable',
51
'midonet_key_fingerprint':
52
'BC4E4E90DDA81C21396081CC67B38D3A054314CD',
58
'http://%s:%s@apt.midokura.com/midonet/v1.9/stable',
59
'midonet_openstack_repo':
60
'http://%s:%s@apt.midokura.com/openstack/kilo/stable',
63
'midonet_key_fingerprint':
64
'BC4E4E90DDA81C21396081CC67B38D3A054314CD',
68
('juno/midonet-2015.03', {
70
'http://repo.midonet.org/midonet/v2015.03',
74
('kilo/midonet-2015.03', {
76
'http://repo.midonet.org/midonet/v2015.03',
83
def config(midonet_rel=None, user=None, password=None):
86
if midonet_rel in (None, '', 'latest'):
87
cfg['midonet_latest'] = True
89
if midonet_rel not in RELEASES:
90
raise ValueError('Unrecognized release %s' % midonet_rel)
91
cfg = dict(RELEASES[midonet_rel])
92
mem = midonet_rel.split('/')[1].startswith('mem')
94
if user is None or password is None:
95
raise ValueError('MEM releases require credentials')
96
cfg['midonet_repo'] = cfg['midonet_repo'] % (user, password)