From 2adcb0e79090fc39af7405dc2715c1403a5859c0 Mon Sep 17 00:00:00 2001 From: Sebastian Simon Date: Tue, 24 Sep 2024 15:57:23 +0200 Subject: [PATCH] Fix port regex in docker-compose plugin --- .gitignore | 3 ++- src/cfgnet/plugins/concept/docker_compose_plugin.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0309ef2..18cd7b1 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ docs/_build/* .cfgnet .idea/* .vscode -env/* \ No newline at end of file +env/* +*.env \ No newline at end of file diff --git a/src/cfgnet/plugins/concept/docker_compose_plugin.py b/src/cfgnet/plugins/concept/docker_compose_plugin.py index 160a9db..9d499aa 100644 --- a/src/cfgnet/plugins/concept/docker_compose_plugin.py +++ b/src/cfgnet/plugins/concept/docker_compose_plugin.py @@ -36,13 +36,13 @@ def _parse_scalar_node(self, node, parent): if node.value != "": match = DockerComposePlugin.ports.match(node.value) if match is not None: - port_in = ValueNode(name=match.group("host")) - port_out = ValueNode(name=match.group("container")) + port_in = ValueNode(name=match.group("in")) + port_out = ValueNode(name=match.group("out")) option_port_in = OptionNode( - "host", node.start_mark.line + 1, ConfigType.PORT + "in", node.start_mark.line + 1, ConfigType.PORT ) option_port_out = OptionNode( - "container", node.start_mark.line + 1, ConfigType.PORT + "out", node.start_mark.line + 1, ConfigType.PORT ) parent.add_child(option_port_in) parent.add_child(option_port_out)