~ionutbalutoiu/charms/trusty/neutron-api/next

« back to all changes in this revision

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

  • Committer: Corey Bryant
  • Date: 2015-04-02 20:15:28 UTC
  • mfrom: (81.1.6 trunk) (96 trunk)
  • mto: This revision was merged to the branch mainline in revision 102.
  • Revision ID: corey.bryant@canonical.com-20150402201528-4sofyas6dazz0e45
Deploy from source

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]