novaclient error when creating floating ip bulk

Bug #1437244 reported by Alexander Gubanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
Critical
Sean Dague

Bug Description

When you create nova floating ip bulk got error, but bulk IPs successfully created.

Python 2.7.3 (default, Aug 14 2014, 22:51:04)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from novaclient.v1_1 import client
>>> from novaclient.v1_1 import floating_ips_bulk
>>> nova = client.Client("admin", "admin", "admin", "http://192.168.0.2:5000/v2.0/", service_type="compute")
>>> nova.floating_ips_bulk.create("10.123.5.50/30", pool="net04_ext")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/floating_ips_bulk.py", line 24, in __repr__
    return "<FloatingIP: %s>" % self.address
  File "/usr/lib/python2.7/dist-packages/novaclient/openstack/common/apiclient/base.py", line 471, in __getattr__
    return self.__getattr__(k)
  File "/usr/lib/python2.7/dist-packages/novaclient/openstack/common/apiclient/base.py", line 473, in __getattr__
    raise AttributeError(k)
AttributeError: address

Revision history for this message
Andriy Kurilin (andreykurilin) wrote :

Available attributes in FloatingIP:

{
     'manager': <novaclient.v2.floating_ips_bulk.FloatingIPBulkManager object at 0x7f514e1fe050>,
     'ip_range': u'10.123.7.50/30',
     'interface': u'eth0',
     '_info': {u'interface': u'eth0', u'ip_range': u'10.123.7.50/30', u'pool': u'net04_ext'},
     'pool': u'net04_ext',
     '_loaded': True
}

Changed in python-novaclient:
status: New → Confirmed
Changed in python-novaclient:
assignee: nobody → Eugeniya Kudryashova (ekudryashova)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/168297

Changed in python-novaclient:
status: Confirmed → In Progress
melanie witt (melwitt)
Changed in python-novaclient:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/168297
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=d614dbcab9cc8c5732ce28c655738218e147aad7
Submitter: Jenkins
Branch: master

commit d614dbcab9cc8c5732ce28c655738218e147aad7
Author: Eugeniya Kudryashova <email address hidden>
Date: Fri Mar 27 13:00:07 2015 +0200

    Fix repr of FloatingIPBulk

    While creating floting ip range returned by API object doesn't contains
    attribute 'address', but repr tries to get it. So change list to return
    objects of FloatingIP and add repr to FloatingIP,
    also changed repr of FloatingIpRange to return actual range of addresses

    Closes-bug: #1437244
    Change-Id: Ia9e30a3f3d82fa8dde113b40d2da372bf1e7a086

Changed in python-novaclient:
status: In Progress → Fix Committed
Revision history for this message
Ethan Lynn (ethanlynn) wrote :

I still have this error when using novaclient 2.24

I using heat to create a eip
and heat will using novaclient to create a ips

 ips = self.nova().floating_ips.create()
https://github.com/openstack/heat/blob/a4afc88b4c06028a3e8ed65b44e9463015c1edd6/heat/engine/resources/aws/ec2/eip.py#L109

later log it
LOG.info(_LI('ElasticIp create %s'), str(ips))
https://github.com/openstack/heat/blob/a4afc88b4c06028a3e8ed65b44e9463015c1edd6/heat/engine/resources/aws/ec2/eip.py#L120

and here will get an error.

2015-04-22 15:50:44.719 TRACE heat.engine.resource Traceback (most recent call last):
2015-04-22 15:50:44.719 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 489, in _action_recorder
2015-04-22 15:50:44.719 TRACE heat.engine.resource yield
2015-04-22 15:50:44.719 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 559, in _do_action
2015-04-22 15:50:44.719 TRACE heat.engine.resource yield self.action_handler_task(action, args=handler_args)
2015-04-22 15:50:44.719 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 296, in wrapper
2015-04-22 15:50:44.719 TRACE heat.engine.resource step = next(subtask)
2015-04-22 15:50:44.719 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 530, in action_handler_task
2015-04-22 15:50:44.719 TRACE heat.engine.resource handler_data = handler(*args)
2015-04-22 15:50:44.719 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/aws/ec2/eip.py", line 121, in handle_create
2015-04-22 15:50:44.719 TRACE heat.engine.resource LOG.info(_LI('ElasticIp create %s'), str(ips))
2015-04-22 15:50:44.719 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/v2/floating_ips.py", line 28, in __repr__
2015-04-22 15:50:44.719 TRACE heat.engine.resource return "<FloatingIP: %s>" % self.address
2015-04-22 15:50:44.719 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/novaclient/openstack/common/apiclient/base.py", line 480, in __getattr__
2015-04-22 15:50:44.719 TRACE heat.engine.resource raise AttributeError(k)
2015-04-22 15:50:44.719 TRACE heat.engine.resource AttributeError: address

Ethan Lynn (ethanlynn)
Changed in python-novaclient:
status: Fix Committed → New
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/176228

Changed in python-novaclient:
assignee: Eugeniya Kudryashova (ekudryashova) → Angus Salkeld (asalkeld)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/176252

Changed in python-novaclient:
assignee: Angus Salkeld (asalkeld) → Sean Dague (sdague)
Revision history for this message
John Garbutt (johngarbutt) wrote :

moving to critical as this is blocking the heat gate

Changed in python-novaclient:
importance: Medium → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/176252
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=31f97a011b6a563e1cec16c16422a288e4a6ea80
Submitter: Jenkins
Branch: master

commit 31f97a011b6a563e1cec16c16422a288e4a6ea80
Author: Sean Dague <email address hidden>
Date: Wed Apr 22 06:55:31 2015 -0400

    fix FloatingIP repr

    The FloatingIP repr added in d614dbcab9cc8c5732ce28c655738218e147aad7
    is incorrect, and can cause fails when you attempt to do bulk creation
    activities with logging turned on.

    This removes the __repr__ for FloatingIP so that it fails back to the
    Resource defaults which are safe.

    Partial Revert of d614dbcab9cc8c5732ce28c655738218e147aad7

    Closes-Bug: #1437244

    Change-Id: I8cedf418917157ce632606bef640049140134372

Changed in python-novaclient:
status: In Progress → Fix Committed
Sean Dague (sdague)
Changed in python-novaclient:
milestone: none → 2.24.1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-novaclient (master)

Change abandoned by Angus Salkeld (<email address hidden>) on branch: master
Review: https://review.openstack.org/176228

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.