Cannot get router.external_gateway_info if it is None
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack SDK |
Fix Committed
|
Undecided
|
Tang Chen |
Bug Description
Now, python-
# openstack router create aaa [1]
# openstack router list --long [2]
'NoneType' object is not iterable
To reproduce this, please install the latest OSC.
The cause of this problem is: Using command [1] to create a router, no option is specified, then the router's external_
class Router(
......
#: The ``network_id``, for the external gateway. *Type: dict*
external_
......
resource.prop() will restrict the type of external_
def __get__(self, instance, owner):
......
if self.type and not isinstance(value, self.type):
if issubclass(
if isinstance(value, six.string_types):
......
It will fall into this block, and when doing type(None), here it is dict(None), it gives "'NoneType' object is not iterable" error.
The same thing won't happen to router.routes because if there is no routes in the router, router.routes is [], not None.
On OSC side, we can do nothing. So there are two solution:
1. Modify neutron to return a {}, not None, if the external_
2. Modify SDK to check if an attr is None, do not do type() on it because self.type could be overwritten to any type.
Changed in python-openstacksdk: | |
assignee: | nobody → Tang Chen (tangchen) |
description: | updated |
Changed in python-openstacksdk: | |
status: | New → Confirmed |
Changed in python-openstacksdk: | |
status: | Confirmed → Fix Committed |
Fix proposed to branch: master /review. openstack. org/259745
Review: https:/