[gnuoy,trivial] Pre-release charmhelper sync
This commit is contained in:
parent
6341bc635d
commit
1112820bc8
@ -46,15 +46,22 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
stable or next branches for the other_services."""
|
stable or next branches for the other_services."""
|
||||||
base_charms = ['mysql', 'mongodb']
|
base_charms = ['mysql', 'mongodb']
|
||||||
|
|
||||||
|
if self.series in ['precise', 'trusty']:
|
||||||
|
base_series = self.series
|
||||||
|
else:
|
||||||
|
base_series = self.current_next
|
||||||
|
|
||||||
if self.stable:
|
if self.stable:
|
||||||
for svc in other_services:
|
for svc in other_services:
|
||||||
temp = 'lp:charms/{}'
|
temp = 'lp:charms/{}/{}'
|
||||||
svc['location'] = temp.format(svc['name'])
|
svc['location'] = temp.format(base_series,
|
||||||
|
svc['name'])
|
||||||
else:
|
else:
|
||||||
for svc in other_services:
|
for svc in other_services:
|
||||||
if svc['name'] in base_charms:
|
if svc['name'] in base_charms:
|
||||||
temp = 'lp:charms/{}'
|
temp = 'lp:charms/{}/{}'
|
||||||
svc['location'] = temp.format(svc['name'])
|
svc['location'] = temp.format(base_series,
|
||||||
|
svc['name'])
|
||||||
else:
|
else:
|
||||||
temp = 'lp:~openstack-charmers/charms/{}/{}/next'
|
temp = 'lp:~openstack-charmers/charms/{}/{}/next'
|
||||||
svc['location'] = temp.format(self.current_next,
|
svc['location'] = temp.format(self.current_next,
|
||||||
@ -99,10 +106,12 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
Return an integer representing the enum value of the openstack
|
Return an integer representing the enum value of the openstack
|
||||||
release.
|
release.
|
||||||
"""
|
"""
|
||||||
|
# Must be ordered by OpenStack release (not by Ubuntu release):
|
||||||
(self.precise_essex, self.precise_folsom, self.precise_grizzly,
|
(self.precise_essex, self.precise_folsom, self.precise_grizzly,
|
||||||
self.precise_havana, self.precise_icehouse,
|
self.precise_havana, self.precise_icehouse,
|
||||||
self.trusty_icehouse, self.trusty_juno, self.trusty_kilo,
|
self.trusty_icehouse, self.trusty_juno, self.utopic_juno,
|
||||||
self.utopic_juno, self.vivid_kilo) = range(10)
|
self.trusty_kilo, self.vivid_kilo) = range(10)
|
||||||
|
|
||||||
releases = {
|
releases = {
|
||||||
('precise', None): self.precise_essex,
|
('precise', None): self.precise_essex,
|
||||||
('precise', 'cloud:precise-folsom'): self.precise_folsom,
|
('precise', 'cloud:precise-folsom'): self.precise_folsom,
|
||||||
|
@ -79,6 +79,9 @@ class AmuletUtils(object):
|
|||||||
for k, v in six.iteritems(commands):
|
for k, v in six.iteritems(commands):
|
||||||
for cmd in v:
|
for cmd in v:
|
||||||
output, code = k.run(cmd)
|
output, code = k.run(cmd)
|
||||||
|
self.log.debug('{} `{}` returned '
|
||||||
|
'{}'.format(k.info['unit_name'],
|
||||||
|
cmd, code))
|
||||||
if code != 0:
|
if code != 0:
|
||||||
return "command `{}` returned {}".format(cmd, str(code))
|
return "command `{}` returned {}".format(cmd, str(code))
|
||||||
return None
|
return None
|
||||||
@ -86,7 +89,11 @@ class AmuletUtils(object):
|
|||||||
def _get_config(self, unit, filename):
|
def _get_config(self, unit, filename):
|
||||||
"""Get a ConfigParser object for parsing a unit's config file."""
|
"""Get a ConfigParser object for parsing a unit's config file."""
|
||||||
file_contents = unit.file_contents(filename)
|
file_contents = unit.file_contents(filename)
|
||||||
config = ConfigParser.ConfigParser()
|
|
||||||
|
# NOTE(beisner): by default, ConfigParser does not handle options
|
||||||
|
# with no value, such as the flags used in the mysql my.cnf file.
|
||||||
|
# https://bugs.python.org/issue7005
|
||||||
|
config = ConfigParser.ConfigParser(allow_no_value=True)
|
||||||
config.readfp(io.StringIO(file_contents))
|
config.readfp(io.StringIO(file_contents))
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
@ -46,15 +46,22 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
stable or next branches for the other_services."""
|
stable or next branches for the other_services."""
|
||||||
base_charms = ['mysql', 'mongodb']
|
base_charms = ['mysql', 'mongodb']
|
||||||
|
|
||||||
|
if self.series in ['precise', 'trusty']:
|
||||||
|
base_series = self.series
|
||||||
|
else:
|
||||||
|
base_series = self.current_next
|
||||||
|
|
||||||
if self.stable:
|
if self.stable:
|
||||||
for svc in other_services:
|
for svc in other_services:
|
||||||
temp = 'lp:charms/{}'
|
temp = 'lp:charms/{}/{}'
|
||||||
svc['location'] = temp.format(svc['name'])
|
svc['location'] = temp.format(base_series,
|
||||||
|
svc['name'])
|
||||||
else:
|
else:
|
||||||
for svc in other_services:
|
for svc in other_services:
|
||||||
if svc['name'] in base_charms:
|
if svc['name'] in base_charms:
|
||||||
temp = 'lp:charms/{}'
|
temp = 'lp:charms/{}/{}'
|
||||||
svc['location'] = temp.format(svc['name'])
|
svc['location'] = temp.format(base_series,
|
||||||
|
svc['name'])
|
||||||
else:
|
else:
|
||||||
temp = 'lp:~openstack-charmers/charms/{}/{}/next'
|
temp = 'lp:~openstack-charmers/charms/{}/{}/next'
|
||||||
svc['location'] = temp.format(self.current_next,
|
svc['location'] = temp.format(self.current_next,
|
||||||
@ -99,10 +106,12 @@ class OpenStackAmuletDeployment(AmuletDeployment):
|
|||||||
Return an integer representing the enum value of the openstack
|
Return an integer representing the enum value of the openstack
|
||||||
release.
|
release.
|
||||||
"""
|
"""
|
||||||
|
# Must be ordered by OpenStack release (not by Ubuntu release):
|
||||||
(self.precise_essex, self.precise_folsom, self.precise_grizzly,
|
(self.precise_essex, self.precise_folsom, self.precise_grizzly,
|
||||||
self.precise_havana, self.precise_icehouse,
|
self.precise_havana, self.precise_icehouse,
|
||||||
self.trusty_icehouse, self.trusty_juno, self.trusty_kilo,
|
self.trusty_icehouse, self.trusty_juno, self.utopic_juno,
|
||||||
self.utopic_juno, self.vivid_kilo) = range(10)
|
self.trusty_kilo, self.vivid_kilo) = range(10)
|
||||||
|
|
||||||
releases = {
|
releases = {
|
||||||
('precise', None): self.precise_essex,
|
('precise', None): self.precise_essex,
|
||||||
('precise', 'cloud:precise-folsom'): self.precise_folsom,
|
('precise', 'cloud:precise-folsom'): self.precise_folsom,
|
||||||
|
Loading…
Reference in New Issue
Block a user