diff --git a/plugins/lookup/cpus.py b/plugins/lookup/cpus.py index 5d8612a385..4ccfa4f6d8 100644 --- a/plugins/lookup/cpus.py +++ b/plugins/lookup/cpus.py @@ -37,9 +37,7 @@ class LookupModule(LookupBase): vars_ = variables or getattr(self._templar, "available_variables", {}) or {} application_id = str(terms[0]) - service_name = ( - str(terms[1]) if len(terms) == 2 else entity_name(application_id) - ) + service_name = str(terms[1]) if len(terms) == 2 else entity_name(application_id) configured = ConfigLookup().run( [application_id, f"services.{service_name}.cpus"], diff --git a/roles/web-app-seaweedfs/meta/volumes.yml b/roles/web-app-seaweedfs/meta/volumes.yml index 48149a460a..025d1e3d6d 100644 --- a/roles/web-app-seaweedfs/meta/volumes.yml +++ b/roles/web-app-seaweedfs/meta/volumes.yml @@ -1,7 +1,7 @@ --- proxy_config: type: config - source: "{{ [ lookup('container', 'web-app-seaweedfs-console', 'directories.volumes'), 'nginx.conf' ] | path_join }}" + source: "{{ [ lookup('container', 'web-app-seaweedfs', 'directories.volumes'), 'nginx.conf' ] | path_join }}" mode: "0444" mounts: - service: seaweedfs-console diff --git a/tests/lint/ansible/services/test_mcp_consumer_variant.py b/tests/lint/ansible/services/test_mcp_consumer_variant.py index 601aada6c4..61049351e4 100644 --- a/tests/lint/ansible/services/test_mcp_consumer_variant.py +++ b/tests/lint/ansible/services/test_mcp_consumer_variant.py @@ -146,8 +146,7 @@ def offenders() -> list[str]: if is_suppressed_in_head(read_text(str(meta)).splitlines(), _RULE): continue consumer_ids = { - entity_name(c): c - for c in derive_allowed_consumers(role, services_by_role) + entity_name(c): c for c in derive_allowed_consumers(role, services_by_role) } consumers = set(consumer_ids) if not consumers: diff --git a/tests/unit/python/plugins/filter/get/test_docker_paths.py b/tests/unit/python/plugins/filter/get/test_docker_paths.py index 53bcb4d786..f4e92762b1 100644 --- a/tests/unit/python/plugins/filter/get/test_docker_paths.py +++ b/tests/unit/python/plugins/filter/get/test_docker_paths.py @@ -6,9 +6,7 @@ class TestGetDockerPaths(unittest.TestCase): def test_get_docker_paths_uses_entity_name_and_builds_layout(self): import plugins.filter.get.docker_paths as m - with patch( - "utils.docker.paths_utils.entity_name", lambda app_id: "myentity" - ): + with patch("utils.docker.paths_utils.entity_name", lambda app_id: "myentity"): out = m.get_docker_paths("web-app-anything", "/opt/compose/") self.assertEqual(out["directories"]["instance"], "/opt/compose/myentity/") diff --git a/tests/unit/python/plugins/filter/get/test_entity_name.py b/tests/unit/python/plugins/filter/get/test_entity_name.py index cb6d31b7a5..b34014dc2c 100644 --- a/tests/unit/python/plugins/filter/get/test_entity_name.py +++ b/tests/unit/python/plugins/filter/get/test_entity_name.py @@ -39,9 +39,7 @@ class TestGetEntityNameFilter(unittest.TestCase): root.start() self.addCleanup(root.stop) - entity_root = patch( - "utils.roles.entity.name.PROJECT_ROOT", Path(self.temp_dir) - ) + entity_root = patch("utils.roles.entity.name.PROJECT_ROOT", Path(self.temp_dir)) entity_root.start() self.addCleanup(entity_root.stop) diff --git a/tests/unit/python/plugins/lookup/test_objstore.py b/tests/unit/python/plugins/lookup/test_objstore.py index e8ec70bc95..0135e5750f 100644 --- a/tests/unit/python/plugins/lookup/test_objstore.py +++ b/tests/unit/python/plugins/lookup/test_objstore.py @@ -58,9 +58,7 @@ class ObjstoreLookupTests(unittest.TestCase): lookup = self._make_lookup(vars_) with ( mock.patch.object(self.mod, "lookup_loader") as loader_mock, - patch.object( - self.mod, "entity_name", side_effect=self._fake_entity_name - ), + patch.object(self.mod, "entity_name", side_effect=self._fake_entity_name), ): loader_mock.get.return_value = mock.MagicMock( run=lambda *_a, **_k: [applications] diff --git a/tests/unit/python/roles/sys-svc-compose/lookup_plugins/test_compose_ca_inject_cmd.py b/tests/unit/python/roles/sys-svc-compose/lookup_plugins/test_compose_ca_inject_cmd.py index a49b3f1fa3..4bc9c105f7 100644 --- a/tests/unit/python/roles/sys-svc-compose/lookup_plugins/test_compose_ca_inject_cmd.py +++ b/tests/unit/python/roles/sys-svc-compose/lookup_plugins/test_compose_ca_inject_cmd.py @@ -121,9 +121,7 @@ class ComposeCaInjectCmdLookupTests(unittest.TestCase): "render_ansible_strict", side_effect=lambda **kw: kw["raw"], ), - patch.object( - self.mod, "entity_name", side_effect=lambda _x: "myproj" - ), + patch.object(self.mod, "entity_name", side_effect=lambda _x: "myproj"), ): lk = self._mk_lookup_module() out = lk.run(["web-app-test"], variables=variables) @@ -195,9 +193,7 @@ class ComposeCaInjectCmdLookupTests(unittest.TestCase): "render_ansible_strict", side_effect=lambda **kw: kw["raw"], ), - patch.object( - self.mod, "entity_name", side_effect=lambda _x: "myproj" - ), + patch.object(self.mod, "entity_name", side_effect=lambda _x: "myproj"), ): lk = self._mk_lookup_module() out = lk.run(["web-app-test"], variables=variables) diff --git a/utils/networks/render.py b/utils/networks/render.py index 74c69bb30c..c370a71313 100644 --- a/utils/networks/render.py +++ b/utils/networks/render.py @@ -98,9 +98,7 @@ def shared_network_compose_key( attachments, _ = _compute_attachments( registry, application_id, deployment_mode, lookup_config, lookup_database ) - return _shared_network_key( - attachments, entity_name(application_id), entity_name - ) + return _shared_network_key(attachments, entity_name(application_id), entity_name) def compute_external_network_roles(