Replaced deprecated function to add a new source

This change only replaced the deprecated function to add a new source
in the `do_openstack_upgrade` function. The original idea of this patch
was to fix an issue that was fixed in another patch.

Copy the new version of the requirements.txt and test-requirements.txt
files to avoid pip 20.3.

Change-Id: I523e2db35cfb0f7533831e5b5fbb802b628b0431
This commit is contained in:
Robert Gildein 2020-11-18 15:42:32 +01:00
parent c6613aa969
commit ed1bbfd769
2 changed files with 6 additions and 10 deletions

View File

@ -30,7 +30,6 @@ from charmhelpers.contrib.openstack.neutron import (
from charmhelpers.contrib.openstack.utils import (
os_release,
get_os_codename_install_source,
configure_installation_source,
incomplete_relation_data,
is_unit_paused_set,
make_assess_status_func,
@ -650,9 +649,10 @@ def do_openstack_upgrade(configs):
new_src = config('openstack-origin')
new_os_rel = get_os_codename_install_source(new_src)
log('Performing OpenStack upgrade to %s.' % (new_os_rel))
log('Performing OpenStack upgrade to {}.'.format(new_os_rel))
add_source(new_src)
configure_installation_source(new_src)
dpkg_opts = [
'--option', 'Dpkg::Options::=--force-confnew',
'--option', 'Dpkg::Options::=--force-confdef',

View File

@ -43,7 +43,7 @@ TO_PATCH = [
'add_source',
'b64encode',
'config',
'configure_installation_source',
'add_source',
'get_os_codename_install_source',
'log',
'lsb_release',
@ -366,9 +366,7 @@ class TestNeutronAPIUtils(CharmTestCase):
nutils.do_openstack_upgrade(configs)
self.os_release.assert_called_with('neutron-common')
self.assertTrue(self.log.called)
self.configure_installation_source.assert_called_with(
'cloud:trusty-juno'
)
self.add_source.assert_called_with('cloud:trusty-juno')
self.apt_update.assert_called_with(fatal=True)
dpkg_opts = [
'--option', 'Dpkg::Options::=--force-confnew',
@ -510,9 +508,7 @@ class TestNeutronAPIUtils(CharmTestCase):
nutils.do_openstack_upgrade(configs)
self.os_release.assert_called_with('neutron-common')
self.assertTrue(self.log.called)
self.configure_installation_source.assert_called_with(
'cloud:trusty-juno'
)
self.add_source.assert_called_with('cloud:trusty-juno')
self.apt_update.assert_called_with(fatal=True)
dpkg_opts = [
'--option', 'Dpkg::Options::=--force-confnew',