Merge lp:~corey.bryant/charm-helpers/dfs-defaults into lp:charm-helpers

Proposed by Corey Bryant
Status: Merged
Merged at revision: 583
Proposed branch: lp:~corey.bryant/charm-helpers/dfs-defaults
Merge into: lp:charm-helpers
Diff against target: 93 lines (+69/-0)
1 file modified
charmhelpers/contrib/openstack/utils.py (+69/-0)
To merge this branch: bzr merge lp:~corey.bryant/charm-helpers/dfs-defaults
Reviewer Review Type Date Requested Status
James Page Pending
charmers Pending
Review via email: mp+295945@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Corey Bryant (corey.bryant) wrote :

In order to deploy from source, the openstack charms have an openstack-origin-git config option, that currently only supports a YAML string that specifies the git repositories to deploy from.

This adds support for default openstack-origin-git values. The default values supported are: icehouse, kilo, liberty, mitaka, and master. For example: openstack-origin-git=master.

This will allow an openstack charm to deploy from the corresponding branch of the OpenStack repository on github.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/openstack/utils.py'
2--- charmhelpers/contrib/openstack/utils.py 2016-05-27 09:05:48 +0000
3+++ charmhelpers/contrib/openstack/utils.py 2016-05-27 12:24:53 +0000
4@@ -51,6 +51,7 @@
5 related_units,
6 relation_ids,
7 relation_set,
8+ service_name,
9 status_set,
10 hook_name
11 )
12@@ -207,6 +208,27 @@
13 ]),
14 }
15
16+GIT_DEFAULT_REPOS = {
17+ 'requirements': 'git://github.com/openstack/requirements',
18+ 'cinder': 'git://github.com/openstack/cinder',
19+ 'glance': 'git://github.com/openstack/glance',
20+ 'horizon': 'git://github.com/openstack/horizon',
21+ 'keystone': 'git://github.com/openstack/keystone',
22+ 'neutron': 'git://github.com/openstack/neutron',
23+ 'neutron-fwaas': 'git://github.com/openstack/neutron-fwaas',
24+ 'neutron-lbaas': 'git://github.com/openstack/neutron-lbaas',
25+ 'neutron-vpnaas': 'git://github.com/openstack/neutron-vpnaas',
26+ 'nova': 'git://github.com/openstack/nova',
27+}
28+
29+GIT_DEFAULT_BRANCHES = {
30+ 'icehouse': 'icehouse-eol',
31+ 'kilo': 'stable/kilo',
32+ 'liberty': 'stable/liberty',
33+ 'mitaka': 'stable/mitaka',
34+ 'master': 'master',
35+}
36+
37 DEFAULT_LOOPBACK_SIZE = '5G'
38
39
40@@ -703,6 +725,53 @@
41 requirements_dir = None
42
43
44+def git_default_repos(projects):
45+ """
46+ Returns default repos if a default openstack-origin-git value is specified.
47+ """
48+ service = service_name()
49+
50+ for default, branch in GIT_DEFAULT_BRANCHES.iteritems():
51+ if projects == default:
52+
53+ # add the requirements repo first
54+ repo = {
55+ 'name': 'requirements',
56+ 'repository': GIT_DEFAULT_REPOS['requirements'],
57+ 'branch': branch,
58+ }
59+ repos = [repo]
60+
61+ # neutron and nova charms require some additional repos
62+ if service == 'neutron':
63+ for svc in ['neutron-fwaas', 'neutron-lbaas', 'neutron-vpnaas']:
64+ repo = {
65+ 'name': svc,
66+ 'repository': GIT_DEFAULT_REPOS[svc],
67+ 'branch': branch,
68+ }
69+ repos.append(repo)
70+ elif service == 'nova':
71+ repo = {
72+ 'name': 'neutron',
73+ 'repository': GIT_DEFAULT_REPOS['neutron'],
74+ 'branch': branch,
75+ }
76+ repos.append(repo)
77+
78+ # finally add the current service's repo
79+ repo = {
80+ 'name': service,
81+ 'repository': GIT_DEFAULT_REPOS[service],
82+ 'branch': branch,
83+ }
84+ repos.append(repo)
85+
86+ return yaml.dump(dict(repositories=repos))
87+
88+ return projects
89+
90+
91 def _git_yaml_load(projects_yaml):
92 """
93 Load the specified yaml into a dictionary.

Subscribers

People subscribed via source and target branches