Fix pep8 failures due to new hacking rules

Change-Id: Ie6cb4e8d6ab0ce5036566dd6900c45b734f1eb3d
This commit is contained in:
Andrey Kurilin 2024-01-03 15:46:46 +01:00
parent 9511371f73
commit 615961558d
2 changed files with 3 additions and 3 deletions

View File

@ -109,7 +109,7 @@ class VMScenario(nova_utils.NovaScenario):
if interpreter:
if isinstance(interpreter, str):
interpreter = [interpreter]
elif type(interpreter) != list:
elif not isinstance(interpreter, list):
raise ValueError("command 'interpreter' value must be str "
"or list type")
cmd.extend(interpreter)
@ -118,7 +118,7 @@ class VMScenario(nova_utils.NovaScenario):
if remote_path:
if isinstance(remote_path, str):
remote_path = [remote_path]
elif type(remote_path) != list:
elif not isinstance(remote_path, list):
raise ValueError("command 'remote_path' value must be str "
"or list type")
cmd.extend(remote_path)

View File

@ -556,7 +556,7 @@ class NeutronScenarioTestCase(test.ScenarioTestCase):
"context": {"tenant": {"networks":
[mock.MagicMock(), mock.MagicMock()]}}})
@ddt.unpack
@mock.patch("random.choice", side_effect=lambda l: l[0])
@mock.patch("random.choice", side_effect=lambda items: items[0])
def test_get_or_create_network(self, mock_random_choice,
network_create_args=None, context=None):
self.scenario.context = context