Fix manager.py launch python version to match installed payload
The manager.py helper is launched with either py2 or py3 depending on
the version of the payload. However, it was using openstack-origin
rather than actually picking up the actual version of the installed
software. This patch ensures that the manager.py is run with the
python version of the installed payload, which resolves a bug when
upgrading to rocky (which is the py2 to py3 transition of the payload).
Also fixes an os.execl() bug which changed behaviour from python2 to
python3.
Closes-bug: #1818988
(cherry picked from commit 627ab761dd)
Change-Id: Ie56374f5882619239f544aaeea4acf92d3d0879d
This commit is contained in:
committed by
Alex Kavanagh (tinwood)
parent
f8c4a81803
commit
0c0b4ed48f
@@ -53,7 +53,8 @@ def openstack_upgrade():
|
||||
if (do_action_openstack_upgrade('keystone',
|
||||
do_openstack_upgrade,
|
||||
register_configs())):
|
||||
os.execl('./hooks/config-changed-postupgrade', '')
|
||||
os.execl('./hooks/config-changed-postupgrade',
|
||||
'config-changed-postupgrade')
|
||||
|
||||
if __name__ == '__main__':
|
||||
openstack_upgrade()
|
||||
|
||||
@@ -1108,9 +1108,7 @@ class ManagerServer():
|
||||
def _launch_manager(self):
|
||||
script = os.path.abspath(os.path.join(os.path.dirname(__file__),
|
||||
'manager.py'))
|
||||
release = CompareOpenStackReleases(
|
||||
get_os_codename_install_source(config('openstack-origin'))
|
||||
)
|
||||
release = CompareOpenStackReleases(os_release('keystone'))
|
||||
# need to set the environment variable PYTHONPATH to include the
|
||||
# payload's directory for the manager.py to find the various keystone
|
||||
# clients
|
||||
|
||||
@@ -56,7 +56,7 @@ class TestKeystoneUpgradeActions(CharmTestCase):
|
||||
|
||||
self.assertTrue(self.do_openstack_upgrade.called)
|
||||
self.os.execl.assert_called_with('./hooks/config-changed-postupgrade',
|
||||
'')
|
||||
'config-changed-postupgrade')
|
||||
|
||||
@patch.object(openstack_upgrade, 'register_configs')
|
||||
@patch('charmhelpers.contrib.openstack.utils.config')
|
||||
|
||||
Reference in New Issue
Block a user