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
=== modified file 'charmhelpers/contrib/openstack/utils.py'
--- charmhelpers/contrib/openstack/utils.py 2016-05-27 09:05:48 +0000
+++ charmhelpers/contrib/openstack/utils.py 2016-05-27 12:24:53 +0000
@@ -51,6 +51,7 @@
51 related_units,51 related_units,
52 relation_ids,52 relation_ids,
53 relation_set,53 relation_set,
54 service_name,
54 status_set,55 status_set,
55 hook_name56 hook_name
56)57)
@@ -207,6 +208,27 @@
207 ]),208 ]),
208}209}
209210
211GIT_DEFAULT_REPOS = {
212 'requirements': 'git://github.com/openstack/requirements',
213 'cinder': 'git://github.com/openstack/cinder',
214 'glance': 'git://github.com/openstack/glance',
215 'horizon': 'git://github.com/openstack/horizon',
216 'keystone': 'git://github.com/openstack/keystone',
217 'neutron': 'git://github.com/openstack/neutron',
218 'neutron-fwaas': 'git://github.com/openstack/neutron-fwaas',
219 'neutron-lbaas': 'git://github.com/openstack/neutron-lbaas',
220 'neutron-vpnaas': 'git://github.com/openstack/neutron-vpnaas',
221 'nova': 'git://github.com/openstack/nova',
222}
223
224GIT_DEFAULT_BRANCHES = {
225 'icehouse': 'icehouse-eol',
226 'kilo': 'stable/kilo',
227 'liberty': 'stable/liberty',
228 'mitaka': 'stable/mitaka',
229 'master': 'master',
230}
231
210DEFAULT_LOOPBACK_SIZE = '5G'232DEFAULT_LOOPBACK_SIZE = '5G'
211233
212234
@@ -703,6 +725,53 @@
703requirements_dir = None725requirements_dir = None
704726
705727
728def git_default_repos(projects):
729 """
730 Returns default repos if a default openstack-origin-git value is specified.
731 """
732 service = service_name()
733
734 for default, branch in GIT_DEFAULT_BRANCHES.iteritems():
735 if projects == default:
736
737 # add the requirements repo first
738 repo = {
739 'name': 'requirements',
740 'repository': GIT_DEFAULT_REPOS['requirements'],
741 'branch': branch,
742 }
743 repos = [repo]
744
745 # neutron and nova charms require some additional repos
746 if service == 'neutron':
747 for svc in ['neutron-fwaas', 'neutron-lbaas', 'neutron-vpnaas']:
748 repo = {
749 'name': svc,
750 'repository': GIT_DEFAULT_REPOS[svc],
751 'branch': branch,
752 }
753 repos.append(repo)
754 elif service == 'nova':
755 repo = {
756 'name': 'neutron',
757 'repository': GIT_DEFAULT_REPOS['neutron'],
758 'branch': branch,
759 }
760 repos.append(repo)
761
762 # finally add the current service's repo
763 repo = {
764 'name': service,
765 'repository': GIT_DEFAULT_REPOS[service],
766 'branch': branch,
767 }
768 repos.append(repo)
769
770 return yaml.dump(dict(repositories=repos))
771
772 return projects
773
774
706def _git_yaml_load(projects_yaml):775def _git_yaml_load(projects_yaml):
707 """776 """
708 Load the specified yaml into a dictionary.777 Load the specified yaml into a dictionary.

Subscribers

People subscribed via source and target branches