← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1102402] Re: converting subnet into a dict is inconsistent

 

** Changed in: quantum
       Status: Fix Committed => Fix Released

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

Title:
  converting subnet into a dict is inconsistent

Status in OpenStack Quantum (virtual network service):
  Fix Released

Bug description:
  When a Subnet is converted into a dict the field "gateway_ip" is treated twice.
  Code below:
  def _make_subnet_dict(self, subnet, fields=None):
          res = {'id': subnet['id'],
                 ... 
                 'gateway_ip': subnet['gateway_ip'],
                 ...
                 }
          if subnet['gateway_ip']:
              res['gateway_ip'] = subnet['gateway_ip']

          return self._fields(res, fields)

  So it looks like the value of "gateway_ip" is copied into the result at the first step and  later we check if the value of this field exists in order to copy it to the result. 
  Note: the line " if subnet['gateway_ip']" may throw "Key Error".

  (Code taken from quantum/db/db_base_plugin_v2.py line# 862)

  It is quite clear that the second step is useless since the value was
  copied to the result already.

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