diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py index 710e8fe340..0612b438d8 100644 --- a/openstackclient/network/v2/port.py +++ b/openstackclient/network/v2/port.py @@ -843,7 +843,7 @@ class ListPort(command.Lister): self.app.client_manager, parsed_args ) if parsed_args.security_groups: - filters['security_groups'] = parsed_args.security_groups + filters['security_group_ids'] = parsed_args.security_groups _tag.get_tag_filtering_args(parsed_args, filters) diff --git a/openstackclient/tests/unit/network/v2/test_port.py b/openstackclient/tests/unit/network/v2/test_port.py index c897a1afaa..8d15548a2e 100644 --- a/openstackclient/tests/unit/network/v2/test_port.py +++ b/openstackclient/tests/unit/network/v2/test_port.py @@ -1662,7 +1662,7 @@ class TestListPort(TestPort): columns, data = self.cmd.take_action(parsed_args) filters = { - 'security_groups': ['sg-id1', 'sg-id2'], + 'security_group_ids': ['sg-id1', 'sg-id2'], 'fields': LIST_FIELDS_TO_RETRIEVE, }