~corey.bryant/charms/trusty/nova-compute/amulet-novacc

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/openstack/amulet/deployment.py

  • Committer: Liam Young
  • Date: 2015-04-01 15:13:54 UTC
  • mfrom: (79.3.29 nova-compute)
  • Revision ID: liam.young@canonical.com-20150401151354-ygf2jf3a3qpl50ug
[james-page, r=gnuoy] Add 0mq support

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with charm-helpers.  If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
17
import six
 
18
from collections import OrderedDict
18
19
from charmhelpers.contrib.amulet.deployment import (
19
20
    AmuletDeployment
20
21
)
100
101
           """
101
102
        (self.precise_essex, self.precise_folsom, self.precise_grizzly,
102
103
         self.precise_havana, self.precise_icehouse,
103
 
         self.trusty_icehouse) = range(6)
 
104
         self.trusty_icehouse, self.trusty_juno, self.trusty_kilo) = range(8)
104
105
        releases = {
105
106
            ('precise', None): self.precise_essex,
106
107
            ('precise', 'cloud:precise-folsom'): self.precise_folsom,
107
108
            ('precise', 'cloud:precise-grizzly'): self.precise_grizzly,
108
109
            ('precise', 'cloud:precise-havana'): self.precise_havana,
109
110
            ('precise', 'cloud:precise-icehouse'): self.precise_icehouse,
110
 
            ('trusty', None): self.trusty_icehouse}
 
111
            ('trusty', None): self.trusty_icehouse,
 
112
            ('trusty', 'cloud:trusty-juno'): self.trusty_juno,
 
113
            ('trusty', 'cloud:trusty-kilo'): self.trusty_kilo}
111
114
        return releases[(self.series, self.openstack)]
 
115
 
 
116
    def _get_openstack_release_string(self):
 
117
        """Get openstack release string.
 
118
 
 
119
           Return a string representing the openstack release.
 
120
           """
 
121
        releases = OrderedDict([
 
122
            ('precise', 'essex'),
 
123
            ('quantal', 'folsom'),
 
124
            ('raring', 'grizzly'),
 
125
            ('saucy', 'havana'),
 
126
            ('trusty', 'icehouse'),
 
127
            ('utopic', 'juno'),
 
128
            ('vivid', 'kilo'),
 
129
        ])
 
130
        if self.openstack:
 
131
            os_origin = self.openstack.split(':')[1]
 
132
            return os_origin.split('%s-' % self.series)[1].split('/')[0]
 
133
        else:
 
134
            return releases[self.series]