Merge "Drop python2 logic for upgrades" into stable/wallaby
This commit is contained in:
commit
1d26df46dc
|
@ -252,6 +252,7 @@ EXPORT_DATA = {
|
|||
# Package that need to be to the latest before undercloud
|
||||
# update/update
|
||||
UNDERCLOUD_EXTRA_PACKAGES = [
|
||||
"python3-tripleoclient",
|
||||
"openstack-tripleo-common",
|
||||
"openstack-tripleo-heat-templates",
|
||||
"openstack-tripleo-validations",
|
||||
|
|
|
@ -17,7 +17,6 @@ import fixtures
|
|||
import json
|
||||
import mock
|
||||
import os
|
||||
import sys
|
||||
|
||||
from jinja2 import Template
|
||||
|
||||
|
@ -551,7 +550,6 @@ class TestUndercloudUpgrade(TestPluginV1):
|
|||
|
||||
@mock.patch('tripleoclient.utils.prompt_user_for_confirmation',
|
||||
return_value=True)
|
||||
@mock.patch.object(sys, 'executable', 'python2')
|
||||
# TODO(cjeanner) drop once we have proper oslo.privsep
|
||||
@mock.patch('os.geteuid', return_value=1001)
|
||||
@mock.patch('getpass.getuser', return_value='stack')
|
||||
|
@ -572,7 +570,7 @@ class TestUndercloudUpgrade(TestPluginV1):
|
|||
self.cmd.take_action(parsed_args)
|
||||
mock_run_command.assert_called_with(
|
||||
['sudo', 'dnf', 'upgrade', '-y',
|
||||
'python2-tripleoclient',
|
||||
'python3-tripleoclient',
|
||||
'openstack-tripleo-common',
|
||||
'openstack-tripleo-heat-templates',
|
||||
'openstack-tripleo-validations',
|
||||
|
@ -623,7 +621,6 @@ class TestUndercloudUpgrade(TestPluginV1):
|
|||
'/usr/share/openstack-tripleo-heat-templates/'
|
||||
'undercloud-stack-vstate-dropin.yaml'])
|
||||
|
||||
@mock.patch.object(sys, 'executable', 'python3')
|
||||
# TODO(cjeanner) drop once we have proper oslo.privsep
|
||||
@mock.patch('os.geteuid', return_value=1001)
|
||||
@mock.patch('getpass.getuser', return_value='stack')
|
||||
|
|
|
@ -19,7 +19,6 @@ import argparse
|
|||
import logging
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from openstackclient.i18n import _
|
||||
|
||||
|
@ -245,15 +244,8 @@ class UpgradeUndercloud(InstallUndercloud):
|
|||
utils.ensure_run_as_normal_user()
|
||||
|
||||
if not parsed_args.skip_package_updates:
|
||||
if ('python3' in sys.executable):
|
||||
pyver = '3'
|
||||
else:
|
||||
pyver = '2'
|
||||
client_pkgs = [
|
||||
"python{}-tripleoclient".format(pyver),
|
||||
]
|
||||
pkgs = client_pkgs + constants.UNDERCLOUD_EXTRA_PACKAGES
|
||||
self._update_extra_packages(pkgs, parsed_args.dry_run)
|
||||
self._update_extra_packages(constants.UNDERCLOUD_EXTRA_PACKAGES,
|
||||
parsed_args.dry_run)
|
||||
|
||||
if not parsed_args.dry_run:
|
||||
self._run_upgrade(parsed_args)
|
||||
|
|
Loading…
Reference in New Issue