Charm-helpers sync to pull in service_running fix

Change-Id: If0ccd1a3c4156fedb45fe5bdec8cc74bc7e0257a
Closes-Bug: 1581171
This commit is contained in:
David Ames 2016-05-13 09:43:20 -07:00
parent e2d8622b41
commit 13cf8d9350
4 changed files with 11 additions and 6 deletions

View File

@ -149,6 +149,7 @@ PACKAGE_CODENAMES = {
'neutron-common': OrderedDict([
('7.0', 'liberty'),
('8.0', 'mitaka'),
('8.1', 'mitaka'),
]),
'cinder-common': OrderedDict([
('7.0', 'liberty'),

View File

@ -615,7 +615,7 @@ def pool_exists(service, name):
except CalledProcessError:
return False
return name in out
return name in out.split()
def get_osds(service):

View File

@ -64,8 +64,8 @@ def is_device_mounted(device):
:returns: boolean: True if the path represents a mounted device, False if
it doesn't.
'''
is_partition = bool(re.search(r".*[0-9]+\b", device))
out = check_output(['mount']).decode('UTF-8')
if is_partition:
return bool(re.search(device + r"\b", out))
return bool(re.search(device + r"[0-9]*\b", out))
try:
out = check_output(['lsblk', '-P', device]).decode('UTF-8')
except:
return False
return bool(re.search(r'MOUNTPOINT=".+"', out))

View File

@ -152,6 +152,10 @@ def service_running(service_name):
if ("start/running" in output or "is running" in output or
"up and running" in output):
return True
# Actively check for upstart stopped message(s) as the fall through
# SystemV check can return false positives
if ("stop/waiting" in output):
return False
# Check System V scripts init script return codes
if service_name in systemv_services_running():
return True