← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1789402] [NEW] Security group rule - Other protocol

 

Public bug reported:

If try to create rule with other ip protocol then exception rise.
Cause of problem in openstack_dashboard/api/neutron.py
https://github.com/openstack/horizon/blob/841bce062327d70fb834b99bc2f238323e400a51/openstack_dashboard/api/neutron.py#L418-L441

If we define ip_protocol it mean that we didn't define to_port and from_port.
It means that comparison default values of to_port/from_port(None) with 0 will rise exception.

It can be fixed with something like this:
         if not cidr:
            cidr = None
+        if from_port != None:
            if from_port < 0:
                from_port = None
+        if to_port != None:
            if to_port < 0:
                to_port = None

** Affects: horizon
     Importance: Undecided
         Status: New

** Description changed:

- If try to create rule with ip protocol then exception rise.
+ If try to create rule with other ip protocol then exception rise.
  Cause of problem in openstack_dashboard/api/neutron.py
  https://github.com/openstack/horizon/blob/841bce062327d70fb834b99bc2f238323e400a51/openstack_dashboard/api/neutron.py#L418-L441
  
  If we define ip_protocol it mean that we didn't define to_port and from_port.
  It means that comparison default values of to_port/from_port(None) with 0 will rise exception.
  
  It can be fixed with something like this:
-          if not cidr:
-             cidr = None
+          if not cidr:
+             cidr = None
  +        if from_port != None:
-             if from_port < 0:
-                 from_port = None
+             if from_port < 0:
+                 from_port = None
  +        if to_port != None:
-             if to_port < 0:
-                 to_port = None
+             if to_port < 0:
+                 to_port = None

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1789402

Title:
  Security group rule - Other protocol

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  If try to create rule with other ip protocol then exception rise.
  Cause of problem in openstack_dashboard/api/neutron.py
  https://github.com/openstack/horizon/blob/841bce062327d70fb834b99bc2f238323e400a51/openstack_dashboard/api/neutron.py#L418-L441

  If we define ip_protocol it mean that we didn't define to_port and from_port.
  It means that comparison default values of to_port/from_port(None) with 0 will rise exception.

  It can be fixed with something like this:
           if not cidr:
              cidr = None
  +        if from_port != None:
              if from_port < 0:
                  from_port = None
  +        if to_port != None:
              if to_port < 0:
                  to_port = None

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


Follow ups