server add floating ip fails with "AttributeError: add_floating_ip"

Bug #1743964 reported by James Luhrsen
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
python-novaclient
New
Undecided
Unassigned

Bug Description

using the recent v10.0.0 novaclient, I am not able to use the following cli:

openstack --debug server add floating ip fip_vm_1 10.10.10.12

The --debug error is this:

add_floating_ip
Traceback (most recent call last):
  File "/tmp/openstackclient/lib/python2.7/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/tmp/openstackclient/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/tmp/openstackclient/lib/python2.7/site-packages/cliff/command.py", line 184, in run
    return_code = self.take_action(parsed_args) or 0
  File "/tmp/openstackclient/lib/python2.7/site-packages/openstackclient/compute/v2/server.py", line 266, in take_action
    server.add_floating_ip(parsed_args.ip_address,
  File "/tmp/openstackclient/lib/python2.7/site-packages/novaclient/base.py", line 180, in __getattr__
    raise AttributeError(k)
AttributeError: add_floating_ip
clean_up AddFloatingIP: add_floating_ip
Traceback (most recent call last):
  File "/tmp/openstackclient/lib/python2.7/site-packages/osc_lib/shell.py", line 134, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/tmp/openstackclient/lib/python2.7/site-packages/cliff/app.py", line 279, in run
    result = self.run_subcommand(remainder)
  File "/tmp/openstackclient/lib/python2.7/site-packages/osc_lib/shell.py", line 169, in run_subcommand
    ret_value = super(OpenStackShell, self).run_subcommand(argv)
  File "/tmp/openstackclient/lib/python2.7/site-packages/cliff/app.py", line 400, in run_subcommand
    result = cmd.run(parsed_args)
  File "/tmp/openstackclient/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/tmp/openstackclient/lib/python2.7/site-packages/cliff/command.py", line 184, in run
    return_code = self.take_action(parsed_args) or 0
  File "/tmp/openstackclient/lib/python2.7/site-packages/openstackclient/compute/v2/server.py", line 266, in take_action
    server.add_floating_ip(parsed_args.ip_address,
  File "/tmp/openstackclient/lib/python2.7/site-packages/novaclient/base.py", line 180, in __getattr__
    raise AttributeError(k)
AttributeError: add_floating_ip

END return value: 1

downgrading to v9.0.0 (pip install --upgrade python-novaclient==9.0.0) doesn't have this
problem.

basic steps I used to recreate:

openstack network create l3_ext_net
openstack subnet create --network l3_ext_net --subnet-range 41.0.0.0/24 l3_ext_sub
openstack server create fip_vm_1 --nic net-id=12d6fab8-bd76-4e9d-b383-73fe039498ec --flavor m1.nano --image cirros-0.3.4-x86_64-uec
openstack router add subnet l3_ext_router l3_ext_sub
openstack router set l3_ext_router --external-gateway external-net
openstack floating ip create external-net
openstack --debug server add floating ip fip_vm_1 10.10.10.12

this was noticed in automated CI for the OpenDaylight project yesterday (01/16/2017)
which I think corresponds with the recent version of novaclient. Example:

https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1/netvirt-csit-1node-openstack-ocata-gate-stateful-carbon/251/log_full.html.gz#s1-s3-t12-k2-k2-k1-k7

Revision history for this message
Spencer Yu (yushb) wrote :

The error is raised because add_floating_ip has been removed from novaclient, openstackclient should remove related codes.

Revision history for this message
James Luhrsen (jamo) wrote :

@Spencer, so should we move this bug report to openstackclient instead, or can it be
tracked and fixed from here?

Revision history for this message
Steve Noyes (steve-noyes) wrote :

This is what removed add_floating_ip:

https://review.openstack.org/#/c/459859/

Revision history for this message
Spencer Yu (yushb) wrote :

@James I think it should be fixed in openstackclient and have reported a bug in openstackclient, but consider backwards compatibility, openstackclient may not fix it as soon as possible. You can see:
https://review.openstack.org/#/c/535364/

Revision history for this message
Alec Hothan (ahothan) wrote :

Same problem here, I just upgraded to latest novaclient and got the unpleasant surprise. Now I have to either revert to an older novaclient or find how to do the same using openstack sdk (hopefully it will be supported there).
It would be really nice for those who remove APIs and break backward compatibility that the alternative be published (in a release note for example): equivalent CLI and equivalent python SDK API.

Revision history for this message
James Luhrsen (jamo) wrote :
Revision history for this message
Alec Hothan (ahothan) wrote :

@James, thanks I might have to do something similar as I can't find any documented way to do the same using openstacksdk.
It would look really unwise to remove those novacilent apis without an alternative API so I assume there is one.

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.