Value of network's is_default is incorrect in create

Bug #1745658 reported by Hongbin Lu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
In Progress
Wishlist
Hongbin Lu
python-openstackclient
Won't Fix
Medium
Hongbin Lu

Bug Description

Description
===========
Create a network with '--default' option, the network was created and the 'is_default' attribute was shown as 'True'. However, the 'is_default' attribute was actually not set because it is for external network only.

Reproduce
=========
$ openstack network create --default testnet
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
...
| is_default | True |
...
+---------------------------+--------------------------------------+

$ openstack network show testnet
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
...
| is_default | None |
...
+---------------------------+--------------------------------------+

Expected
========
The response of the create command should have 'is_default' set to None

Actual
======
The response of the create command have 'is_default' set to True

Hongbin Lu (hongbin.lu)
Changed in python-openstackclient:
assignee: nobody → Hongbin Lu (hongbin.lu)
Hongbin Lu (hongbin.lu)
Changed in neutron:
assignee: nobody → Hongbin Lu (hongbin.lu)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: New → In Progress
Revision history for this message
zhaobo (zhaobo6) wrote :
Revision history for this message
Akihiro Motoki (amotoki) wrote :

is_default is a boolean attribute, so I think "None" is a reasonable solution.

On the other hand, it is confusing. For a short term solution, I see the following solutions:
- Neutron returns an exception if is_default==True is specified for a network with router:external==False.
- OSC raise an error before sending a request if --default is specified for a non-external network (--internal option)

Revision history for this message
Akihiro Motoki (amotoki) wrote :

For a short term solution, I think adding a check to OSC sounds better, as a change in neutron response needs a micro-versioning from the perspective of API-SIG but it still take time (at least in Rocky).

Changed in python-openstackclient:
status: New → Confirmed
importance: Undecided → Medium
Changed in neutron:
importance: Undecided → Wishlist
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstackclient (master)

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

Changed in python-openstackclient:
status: Confirmed → In Progress
Hongbin Lu (hongbin.lu)
Changed in neutron:
status: In Progress → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Hongbin Lu (<email address hidden>) on branch: master
Review: https://review.openstack.org/538331
Reason: Fixed in: https://review.openstack.org/#/c/511983/

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-openstackclient 5.1.0

This issue was fixed in the openstack/python-openstackclient 5.1.0 release.

Artem Goncharov (gtema)
Changed in python-openstackclient:
status: In Progress → Won't Fix
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.