From f4f9e7c11635614ecf1d9df237f826527ab26f86 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Wed, 7 Aug 2024 13:00:36 -0400 Subject: [PATCH] Remove six library from requirements.txt Six is unused in the code, and generally unused in all of Openstack, so remove it. Fixed bad code in test_save_script_rc_base() that was causing a test failure. Change-Id: Ifff5f4234a14b5ef477a6451cb882780b6a92601 --- hooks/nova_cc_utils.py | 1 - requirements.txt | 1 - unit_tests/test_nova_cc_utils.py | 7 ++++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hooks/nova_cc_utils.py b/hooks/nova_cc_utils.py index f61f6aff..a51a77c9 100644 --- a/hooks/nova_cc_utils.py +++ b/hooks/nova_cc_utils.py @@ -78,7 +78,6 @@ PY3_PACKAGES = [ 'python3-novaclient', 'python3-keystoneclient', 'python3-psutil', - 'python3-six', 'python3-memcache', ] diff --git a/requirements.txt b/requirements.txt index 3b1cb7b1..03e9f9d8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,7 +22,6 @@ cryptography<3.4 netaddr>0.7.16,<0.8.0 Jinja2>=2.6 # BSD License (3 clause) -six>=1.9.0 dnspython diff --git a/unit_tests/test_nova_cc_utils.py b/unit_tests/test_nova_cc_utils.py index 8a9d091e..8c4e7c1b 100644 --- a/unit_tests/test_nova_cc_utils.py +++ b/unit_tests/test_nova_cc_utils.py @@ -67,7 +67,7 @@ TO_PATCH = [ ] SCRIPTRC_ENV_VARS = { - 'OPENSTACK_PORT_MASTPORT': 5404, + 'OPENSTACK_PORT_MCASTPORT': 5404, 'OPENSTACK_SERVICE_API_EC2': 'nova-api-ec2', 'OPENSTACK_SERVICE_API_OS_COMPUTE': 'nova-api-os-compute', 'OPENSTACK_SERVICE_CERT': 'nova-cert', @@ -645,10 +645,11 @@ class NovaCCUtilsTests(CharmTestCase): ex = [8773, 8774] self.assertEqual(ex, sorted(ports)) - def test_save_script_rc_base(self): + @patch('charmhelpers.contrib.openstack.utils.save_script_rc') + def test_save_script_rc_base(self, save_script_rc): self.relation_ids.return_value = [] utils.save_script_rc() - self.save_script_rc.called_with(**SCRIPTRC_ENV_VARS) + save_script_rc.assert_called_with(**SCRIPTRC_ENV_VARS) @patch('charmhelpers.contrib.openstack.utils.lsb_release') def test_get_step_upgrade_source_target_liberty(self, lsb_release):