~openstack-charmers-next/charms/trusty/cinder-ceph/trunk

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/openstack/utils.py

  • Committer: James Page
  • Date: 2016-06-17 10:42:48 UTC
  • Revision ID: james.page@ubuntu.com-20160617104248-8jocp3zyedl7h5gu
Switch to using charm-store for amulet tests

All OpenStack charms are now directly published to the charm store
on landing; switch Amulet helper to resolve charms using the
charm store rather than bzr branches, removing the lag between
charm changes landing and being available for other charms to
use for testing.

This is also important for new layered charms where the charm must
be build and published prior to being consumable.

Change-Id: I05d8199238727ebca25666196cf9060a94d3e7b8

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    related_units,
52
52
    relation_ids,
53
53
    relation_set,
 
54
    service_name,
54
55
    status_set,
55
56
    hook_name
56
57
)
207
208
    ]),
208
209
}
209
210
 
 
211
GIT_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
 
 
224
GIT_DEFAULT_BRANCHES = {
 
225
    'icehouse': 'icehouse-eol',
 
226
    'kilo': 'stable/kilo',
 
227
    'liberty': 'stable/liberty',
 
228
    'mitaka': 'stable/mitaka',
 
229
    'master': 'master',
 
230
}
 
231
 
210
232
DEFAULT_LOOPBACK_SIZE = '5G'
211
233
 
212
234
 
703
725
requirements_dir = None
704
726
 
705
727
 
 
728
def 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
 
706
775
def _git_yaml_load(projects_yaml):
707
776
    """
708
777
    Load the specified yaml into a dictionary.