sync charm-helpers to latest version
Change-Id: I5d6a14bfd5d54d58b5d5515aee9b014216b2c2d3
This commit is contained in:
parent
e268b1bc43
commit
11211653fe
@ -1013,6 +1013,9 @@ class OpenStackAmuletUtils(AmuletUtils):
|
|||||||
cmd, code, output))
|
cmd, code, output))
|
||||||
amulet.raise_status(amulet.FAIL, msg=msg)
|
amulet.raise_status(amulet.FAIL, msg=msg)
|
||||||
|
|
||||||
|
# For mimic ceph osd lspools output
|
||||||
|
output = output.replace("\n", ",")
|
||||||
|
|
||||||
# Example output: 0 data,1 metadata,2 rbd,3 cinder,4 glance,
|
# Example output: 0 data,1 metadata,2 rbd,3 cinder,4 glance,
|
||||||
for pool in str(output).split(','):
|
for pool in str(output).split(','):
|
||||||
pool_id_name = pool.split(' ')
|
pool_id_name = pool.split(' ')
|
||||||
|
@ -1519,6 +1519,14 @@ class NeutronAPIContext(OSContextGenerator):
|
|||||||
'rel_key': 'enable-qos',
|
'rel_key': 'enable-qos',
|
||||||
'default': False,
|
'default': False,
|
||||||
},
|
},
|
||||||
|
'enable_nsg_logging': {
|
||||||
|
'rel_key': 'enable-nsg-logging',
|
||||||
|
'default': False,
|
||||||
|
},
|
||||||
|
'nsg_log_output_base': {
|
||||||
|
'rel_key': 'nsg-log-output-base',
|
||||||
|
'default': None,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
ctxt = self.get_neutron_options({})
|
ctxt = self.get_neutron_options({})
|
||||||
for rid in relation_ids('neutron-plugin-api'):
|
for rid in relation_ids('neutron-plugin-api'):
|
||||||
|
@ -186,7 +186,7 @@ SWIFT_CODENAMES = OrderedDict([
|
|||||||
('queens',
|
('queens',
|
||||||
['2.16.0', '2.17.0']),
|
['2.16.0', '2.17.0']),
|
||||||
('rocky',
|
('rocky',
|
||||||
['2.18.0']),
|
['2.18.0', '2.19.0']),
|
||||||
])
|
])
|
||||||
|
|
||||||
# >= Liberty version->codename mapping
|
# >= Liberty version->codename mapping
|
||||||
@ -1733,3 +1733,19 @@ def is_unit_upgrading_set():
|
|||||||
return not(not(kv.get('unit-upgrading')))
|
return not(not(kv.get('unit-upgrading')))
|
||||||
except Exception:
|
except Exception:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def series_upgrade_prepare(pause_unit_helper=None, configs=None):
|
||||||
|
""" Run common series upgrade prepare tasks."""
|
||||||
|
set_unit_upgrading()
|
||||||
|
if pause_unit_helper and configs:
|
||||||
|
if not is_unit_paused_set():
|
||||||
|
pause_unit_helper(configs)
|
||||||
|
|
||||||
|
|
||||||
|
def series_upgrade_complete(resume_unit_helper=None, configs=None):
|
||||||
|
""" Run common series upgrade complete tasks."""
|
||||||
|
clear_unit_paused()
|
||||||
|
clear_unit_upgrading()
|
||||||
|
if resume_unit_helper and configs:
|
||||||
|
resume_unit_helper(configs)
|
||||||
|
@ -48,6 +48,7 @@ INFO = "INFO"
|
|||||||
DEBUG = "DEBUG"
|
DEBUG = "DEBUG"
|
||||||
TRACE = "TRACE"
|
TRACE = "TRACE"
|
||||||
MARKER = object()
|
MARKER = object()
|
||||||
|
SH_MAX_ARG = 131071
|
||||||
|
|
||||||
cache = {}
|
cache = {}
|
||||||
|
|
||||||
@ -98,7 +99,7 @@ def log(message, level=None):
|
|||||||
command += ['-l', level]
|
command += ['-l', level]
|
||||||
if not isinstance(message, six.string_types):
|
if not isinstance(message, six.string_types):
|
||||||
message = repr(message)
|
message = repr(message)
|
||||||
command += [message]
|
command += [message[:SH_MAX_ARG]]
|
||||||
# Missing juju-log should not cause failures in unit tests
|
# Missing juju-log should not cause failures in unit tests
|
||||||
# Send log output to stderr
|
# Send log output to stderr
|
||||||
try:
|
try:
|
||||||
|
@ -96,6 +96,7 @@ if __platform__ == "ubuntu":
|
|||||||
apt_update = fetch.apt_update
|
apt_update = fetch.apt_update
|
||||||
apt_upgrade = fetch.apt_upgrade
|
apt_upgrade = fetch.apt_upgrade
|
||||||
apt_purge = fetch.apt_purge
|
apt_purge = fetch.apt_purge
|
||||||
|
apt_autoremove = fetch.apt_autoremove
|
||||||
apt_mark = fetch.apt_mark
|
apt_mark = fetch.apt_mark
|
||||||
apt_hold = fetch.apt_hold
|
apt_hold = fetch.apt_hold
|
||||||
apt_unhold = fetch.apt_unhold
|
apt_unhold = fetch.apt_unhold
|
||||||
|
@ -248,6 +248,14 @@ def apt_purge(packages, fatal=False):
|
|||||||
_run_apt_command(cmd, fatal)
|
_run_apt_command(cmd, fatal)
|
||||||
|
|
||||||
|
|
||||||
|
def apt_autoremove(purge=True, fatal=False):
|
||||||
|
"""Purge one or more packages."""
|
||||||
|
cmd = ['apt-get', '--assume-yes', 'autoremove']
|
||||||
|
if purge:
|
||||||
|
cmd.append('--purge')
|
||||||
|
_run_apt_command(cmd, fatal)
|
||||||
|
|
||||||
|
|
||||||
def apt_mark(packages, mark, fatal=False):
|
def apt_mark(packages, mark, fatal=False):
|
||||||
"""Flag one or more packages using apt-mark."""
|
"""Flag one or more packages using apt-mark."""
|
||||||
log("Marking {} as {}".format(packages, mark))
|
log("Marking {} as {}".format(packages, mark))
|
||||||
|
@ -1013,6 +1013,9 @@ class OpenStackAmuletUtils(AmuletUtils):
|
|||||||
cmd, code, output))
|
cmd, code, output))
|
||||||
amulet.raise_status(amulet.FAIL, msg=msg)
|
amulet.raise_status(amulet.FAIL, msg=msg)
|
||||||
|
|
||||||
|
# For mimic ceph osd lspools output
|
||||||
|
output = output.replace("\n", ",")
|
||||||
|
|
||||||
# Example output: 0 data,1 metadata,2 rbd,3 cinder,4 glance,
|
# Example output: 0 data,1 metadata,2 rbd,3 cinder,4 glance,
|
||||||
for pool in str(output).split(','):
|
for pool in str(output).split(','):
|
||||||
pool_id_name = pool.split(' ')
|
pool_id_name = pool.split(' ')
|
||||||
|
@ -48,6 +48,7 @@ INFO = "INFO"
|
|||||||
DEBUG = "DEBUG"
|
DEBUG = "DEBUG"
|
||||||
TRACE = "TRACE"
|
TRACE = "TRACE"
|
||||||
MARKER = object()
|
MARKER = object()
|
||||||
|
SH_MAX_ARG = 131071
|
||||||
|
|
||||||
cache = {}
|
cache = {}
|
||||||
|
|
||||||
@ -98,7 +99,7 @@ def log(message, level=None):
|
|||||||
command += ['-l', level]
|
command += ['-l', level]
|
||||||
if not isinstance(message, six.string_types):
|
if not isinstance(message, six.string_types):
|
||||||
message = repr(message)
|
message = repr(message)
|
||||||
command += [message]
|
command += [message[:SH_MAX_ARG]]
|
||||||
# Missing juju-log should not cause failures in unit tests
|
# Missing juju-log should not cause failures in unit tests
|
||||||
# Send log output to stderr
|
# Send log output to stderr
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user