diff --git a/api/host.py b/api/host.py index 4cbc1fd961..c1da0b7d60 100644 --- a/api/host.py +++ b/api/host.py @@ -181,7 +181,7 @@ def get_host_list( page=1, per_page=100, order_by=None, - order_how=None + order_how=None, ): if fqdn: query = find_hosts_by_canonical_facts( @@ -287,7 +287,7 @@ def find_hosts_by_canonical_facts(account_number, canonical_facts): def find_hosts_by_hostname_or_id(account_number, hostname): logger.debug("find_hosts_by_hostname_or_id(%s)", hostname) filter_list = [Host.display_name.comparator.contains(hostname), - Host.canonical_facts["fqdn"].astext.contains(hostname), ] + Host.canonical_facts["fqdn"].astext.contains(hostname) ] try: uuid.UUID(hostname) diff --git a/test_api.py b/test_api.py index feeafbb28d..5864fd2b7a 100755 --- a/test_api.py +++ b/test_api.py @@ -305,7 +305,7 @@ def test_create_host_update_with_same_insights_id_and_different_canonical_facts( # Change the canonical facts except for the insights_id host_data.rhel_machine_id = generate_uuid() - host_data.ip_addresses = ["192.168.1.44", "10.0.0.2", ] + host_data.ip_addresses = ["192.168.1.44", "10.0.0.2" ] host_data.subscription_manager_id = generate_uuid() host_data.satellite_id = generate_uuid() host_data.bios_uuid = generate_uuid() @@ -876,7 +876,7 @@ def _valid_system_profile(self): "mtu": 1500, "mac_address": "aa:bb:cc:dd:ee:ff", "type": "loopback", - "name": "eth0", }], + "name": "eth0" }], "disk_devices": [{"device": "/dev/sdb1", "label": "home drive", "options": {"uid": "0", @@ -906,7 +906,7 @@ def _valid_system_profile(self): "status": "UP"}, {"name": "jbws", "id": "321", - "status": "DOWN"}, ], + "status": "DOWN"} ], "insights_client_version": "12.0.12", "insights_egg_version": "120.0.1", "installed_packages": ["rpm1", "rpm2"], @@ -987,7 +987,7 @@ def test_create_host_without_system_profile_then_update_with_system_profile(self mq_message = { "id": original_id, "request_id": None, - "system_profile": system_profile + "system_profile": system_profile, } with self.app.app_context(): msg_handler(mq_message) @@ -1025,7 +1025,7 @@ def test_create_host_with_system_profile_with_invalid_data(self): # List of tuples (system profile change, expected system profile) system_profiles = [{"infrastructure_type": "i"*101, "infrastructure_vendor": "i"*101, - "cloud_provider": "i"*101, }] + "cloud_provider": "i"*101 }] for system_profile in system_profiles: with self.subTest(system_profile=system_profile): @@ -1614,7 +1614,7 @@ def _added_hosts_by_display_name_asc(self): self.added_hosts[3], self.added_hosts[0], self.added_hosts[1], - self.added_hosts[2] + self.added_hosts[2], ) def _added_hosts_by_display_name_desc(self): @@ -1623,7 +1623,7 @@ def _added_hosts_by_display_name_desc(self): self.added_hosts[1], # Hosts with same display_name are ordered by updated descending self.added_hosts[3], - self.added_hosts[0] + self.added_hosts[0], ) def _assert_host_ids_in_response(self, response, expected_hosts): diff --git a/test_db_model.py b/test_db_model.py index 9749721a5b..981559f98e 100644 --- a/test_db_model.py +++ b/test_db_model.py @@ -24,7 +24,7 @@ def test_create_host_with_canonical_facts_as_None(flask_app_fixture): # Test to make sure canonical facts that are None or '' do # not get inserted into the db invalid_canonical_facts = {"fqdn": None, - "insights_id": '', } + "insights_id": '' } valid_canonical_facts = {"bios_uuid": "1234"} host_dict = {**invalid_canonical_facts, **valid_canonical_facts} diff --git a/test_unit.py b/test_unit.py index 95dc95a74d..f78dd057a7 100755 --- a/test_unit.py +++ b/test_unit.py @@ -78,7 +78,7 @@ def test_valid(self): identity_data_dicts = [identity_data, # Test with extra data in the identity dict - {**identity_data, **{"extra_data": "value"}}, ] + {**identity_data, **{"extra_data": "value"}} ] for identity_data in identity_data_dicts: with self.subTest(identity_data=identity_data): @@ -287,7 +287,7 @@ def test_order_by_updated_desc(self, modified_on, order_how): @patch("api.host.Host.display_name") def test_default_for_display_name_is_asc(self, display_name, modified_on, order_how): - actual = _params_to_order_by("display_name",) + actual = _params_to_order_by("display_name") expected = (display_name.asc.return_value, modified_on.desc.return_value) self.assertEqual(actual, expected) order_how.assert_not_called()