← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1945747] [NEW] GET security group rule is missing description attribute

 

Public bug reported:

The description attribute is missed attribute in
_make_security_group_rule_dict

Create sec group rule with desc

stack@bionic-template:~/devstack$ openstack security group rule create --description "test rule" --remote-ip 0.0.0.0/0 --ingress ff57f76f-93a0-4bf3-b538-c88df40fdc40
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field             | Value                                                                                                                                                            |
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| created_at        | 2021-10-01T06:35:50Z                                                                                                                                             |
| description       | test rule                                                                                                                                                        |
| direction         | ingress                                                                                                                                                          |
| ether_type        | IPv4                                                                                                                                                             |
| id                | 389eb45e-58ac-471c-b966-a3c8784009f7                                                                                                                             |
| location          | cloud='', project.domain_id='default', project.domain_name=, project.id='f2527eb734c745eca32b1dfbd9107563', project.name='admin', region_name='RegionOne', zone= |
| name              | None                                                                                                                                                             |
| port_range_max    | None                                                                                                                                                             |
| port_range_min    | None                                                                                                                                                             |
| project_id        | f2527eb734c745eca32b1dfbd9107563                                                                                                                                 |
| protocol          | None                                                                                                                                                             |
| remote_group_id   | None                                                                                                                                                             |
| remote_ip_prefix  | None                                                                                                                                                             |
| revision_number   | 0                                                                                                                                                                |
| security_group_id | ff57f76f-93a0-4bf3-b538-c88df40fdc40                                                                                                                             |
| tags              | []                                                                                                                                                               |
| updated_at        | 2021-10-01T06:35:50Z                                                                                                                                             |
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+


Example get (no description)

RESP BODY: {"security_group_rule": {"id":
"389eb45e-58ac-471c-b966-a3c8784009f7", "tenant_id":
"f2527eb734c745eca32b1dfbd9107563", "security_group_id":
"ff57f76f-93a0-4bf3-b538-c88df40fdc40", "ethertype": "IPv4",
"direction": "ingress", "protocol": null, "port_range_min": null,
"port_range_max": null, "remote_ip_prefix": "0.0.0.0/0",
"remote_group_id": null, "local_ip_prefix": null, "created_at":
"2021-10-01T06:35:50Z", "updated_at": "2021-10-01T06:35:50Z",
"revision_number": 0, "project_id": "f2527eb734c745eca32b1dfbd9107563"}}

Potential fix (patch applies to stable/ussuri, not master)

diff --git a/neutron/db/securitygroups_db.py b/neutron/db/securitygroups_db.py
index 28238358ae..0c848bbe38 100644
--- a/neutron/db/securitygroups_db.py
+++ b/neutron/db/securitygroups_db.py
@@ -655,6 +655,7 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase,
 
     def _make_security_group_rule_dict(self, security_group_rule, fields=None):
         res = {'id': security_group_rule['id'],
+               'description': security_group_rule['description'],
                'tenant_id': security_group_rule['tenant_id'],
                'security_group_id': security_group_rule['security_group_id'],
                'ethertype': security_group_rule['ethertype'],


After patch description attribute is present

RESP BODY: {"security_group_rule": {"id":
"389eb45e-58ac-471c-b966-a3c8784009f7", "description": "test rule",
"tenant_id": "f2527eb734c745eca32b1dfbd9107563", "security_group_id":
"ff57f76f-93a0-4bf3-b538-c88df40fdc40", "ethertype": "IPv4",
"direction": "ingress", "protocol": null, "port_range_min": null,
"port_range_max": null, "remote_ip_prefix": "0.0.0.0/0",
"remote_group_id": null, "local_ip_prefix": null, "created_at":
"2021-10-01T06:35:50Z", "updated_at": "2021-10-01T06:35:50Z",
"revision_number": 0, "project_id": "f2527eb734c745eca32b1dfbd9107563"}}

** Affects: neutron
     Importance: Low
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1945747

Title:
  GET security group rule is missing description attribute

Status in neutron:
  New

Bug description:
  The description attribute is missed attribute in
  _make_security_group_rule_dict

  Create sec group rule with desc

  stack@bionic-template:~/devstack$ openstack security group rule create --description "test rule" --remote-ip 0.0.0.0/0 --ingress ff57f76f-93a0-4bf3-b538-c88df40fdc40
  +-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  | Field             | Value                                                                                                                                                            |
  +-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  | created_at        | 2021-10-01T06:35:50Z                                                                                                                                             |
  | description       | test rule                                                                                                                                                        |
  | direction         | ingress                                                                                                                                                          |
  | ether_type        | IPv4                                                                                                                                                             |
  | id                | 389eb45e-58ac-471c-b966-a3c8784009f7                                                                                                                             |
  | location          | cloud='', project.domain_id='default', project.domain_name=, project.id='f2527eb734c745eca32b1dfbd9107563', project.name='admin', region_name='RegionOne', zone= |
  | name              | None                                                                                                                                                             |
  | port_range_max    | None                                                                                                                                                             |
  | port_range_min    | None                                                                                                                                                             |
  | project_id        | f2527eb734c745eca32b1dfbd9107563                                                                                                                                 |
  | protocol          | None                                                                                                                                                             |
  | remote_group_id   | None                                                                                                                                                             |
  | remote_ip_prefix  | None                                                                                                                                                             |
  | revision_number   | 0                                                                                                                                                                |
  | security_group_id | ff57f76f-93a0-4bf3-b538-c88df40fdc40                                                                                                                             |
  | tags              | []                                                                                                                                                               |
  | updated_at        | 2021-10-01T06:35:50Z                                                                                                                                             |
  +-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+

  
  Example get (no description)

  RESP BODY: {"security_group_rule": {"id":
  "389eb45e-58ac-471c-b966-a3c8784009f7", "tenant_id":
  "f2527eb734c745eca32b1dfbd9107563", "security_group_id":
  "ff57f76f-93a0-4bf3-b538-c88df40fdc40", "ethertype": "IPv4",
  "direction": "ingress", "protocol": null, "port_range_min": null,
  "port_range_max": null, "remote_ip_prefix": "0.0.0.0/0",
  "remote_group_id": null, "local_ip_prefix": null, "created_at":
  "2021-10-01T06:35:50Z", "updated_at": "2021-10-01T06:35:50Z",
  "revision_number": 0, "project_id":
  "f2527eb734c745eca32b1dfbd9107563"}}

  Potential fix (patch applies to stable/ussuri, not master)

  diff --git a/neutron/db/securitygroups_db.py b/neutron/db/securitygroups_db.py
  index 28238358ae..0c848bbe38 100644
  --- a/neutron/db/securitygroups_db.py
  +++ b/neutron/db/securitygroups_db.py
  @@ -655,6 +655,7 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase,
   
       def _make_security_group_rule_dict(self, security_group_rule, fields=None):
           res = {'id': security_group_rule['id'],
  +               'description': security_group_rule['description'],
                  'tenant_id': security_group_rule['tenant_id'],
                  'security_group_id': security_group_rule['security_group_id'],
                  'ethertype': security_group_rule['ethertype'],

  
  After patch description attribute is present

  RESP BODY: {"security_group_rule": {"id":
  "389eb45e-58ac-471c-b966-a3c8784009f7", "description": "test rule",
  "tenant_id": "f2527eb734c745eca32b1dfbd9107563", "security_group_id":
  "ff57f76f-93a0-4bf3-b538-c88df40fdc40", "ethertype": "IPv4",
  "direction": "ingress", "protocol": null, "port_range_min": null,
  "port_range_max": null, "remote_ip_prefix": "0.0.0.0/0",
  "remote_group_id": null, "local_ip_prefix": null, "created_at":
  "2021-10-01T06:35:50Z", "updated_at": "2021-10-01T06:35:50Z",
  "revision_number": 0, "project_id":
  "f2527eb734c745eca32b1dfbd9107563"}}

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1945747/+subscriptions



Follow ups