Restarting neutron-server after PG upgrade/downgrade
Making sure neutron-server is restarted after a PG package upgrade/downgrade
This commit is contained in:
commit
1fd81a665b
|
@ -6,7 +6,6 @@
|
||||||
# in this file.
|
# in this file.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from charmhelpers.core.host import service_running
|
|
||||||
from charmhelpers.core.hookenv import (
|
from charmhelpers.core.hookenv import (
|
||||||
Hooks,
|
Hooks,
|
||||||
UnregisteredHookError,
|
UnregisteredHookError,
|
||||||
|
@ -17,7 +16,9 @@ from charmhelpers.core.hookenv import (
|
||||||
|
|
||||||
from charmhelpers.core.host import (
|
from charmhelpers.core.host import (
|
||||||
restart_on_change,
|
restart_on_change,
|
||||||
service_restart
|
service_start,
|
||||||
|
service_stop,
|
||||||
|
service_running
|
||||||
)
|
)
|
||||||
|
|
||||||
from charmhelpers.fetch import (
|
from charmhelpers.fetch import (
|
||||||
|
@ -74,12 +75,14 @@ def config_changed():
|
||||||
pkgs = determine_packages()
|
pkgs = determine_packages()
|
||||||
for pkg in pkgs:
|
for pkg in pkgs:
|
||||||
apt_install(pkg, options=['--force-yes'], fatal=True)
|
apt_install(pkg, options=['--force-yes'], fatal=True)
|
||||||
service_restart('neutron-server')
|
service_stop('neutron-server')
|
||||||
if (charm_config.changed('networking-plumgrid-version') or
|
if (charm_config.changed('networking-plumgrid-version') or
|
||||||
charm_config.changed('pip-proxy')):
|
charm_config.changed('pip-proxy')):
|
||||||
ensure_files()
|
ensure_files()
|
||||||
service_restart('neutron-server')
|
service_stop('neutron-server')
|
||||||
CONFIGS.write_all()
|
CONFIGS.write_all()
|
||||||
|
if not service_running('neutron-server'):
|
||||||
|
service_start('neutron-server')
|
||||||
|
|
||||||
|
|
||||||
@hooks.hook('neutron-plugin-api-relation-joined')
|
@hooks.hook('neutron-plugin-api-relation-joined')
|
||||||
|
|
|
@ -87,17 +87,16 @@ def determine_packages():
|
||||||
enable PLUMgrid in Openstack.
|
enable PLUMgrid in Openstack.
|
||||||
'''
|
'''
|
||||||
pkgs = []
|
pkgs = []
|
||||||
tag = 'latest'
|
|
||||||
for pkg in PG_PACKAGES:
|
for pkg in PG_PACKAGES:
|
||||||
|
tag = ''
|
||||||
if pkg == 'plumgrid-pythonlib':
|
if pkg == 'plumgrid-pythonlib':
|
||||||
tag = config('plumgrid-build')
|
tag = config('plumgrid-build')
|
||||||
elif (pkg == 'networking-plumgrid' and
|
elif (pkg == 'networking-plumgrid' and
|
||||||
config('enable-deb-networking-install')):
|
config('enable-deb-networking-install')):
|
||||||
tag = config('networking-build')
|
tag = config('networking-build')
|
||||||
|
|
||||||
if tag == 'latest':
|
if tag == 'latest':
|
||||||
pkgs.append(pkg)
|
pkgs.append(pkg)
|
||||||
else:
|
elif tag:
|
||||||
if tag in [i.ver_str for i in apt_cache()[pkg].version_list]:
|
if tag in [i.ver_str for i in apt_cache()[pkg].version_list]:
|
||||||
pkgs.append('%s=%s' % (pkg, tag))
|
pkgs.append('%s=%s' % (pkg, tag))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue