Fix net check return error when net_obj get value is "None"
Closes-Bug: #1777774 Change-Id: I6073a075837ee3fdaa6f09c49b76aacbc0d90226
This commit is contained in:
parent
0c6fbcf7c4
commit
d27cba4d5c
|
@ -517,6 +517,8 @@ class ServerProfile(base.Profile):
|
|||
return
|
||||
try:
|
||||
net_obj = nc.network_get(net)
|
||||
if net_obj is None:
|
||||
return _("The specified network %s could not be found.") % net
|
||||
result[self.NETWORK] = net_obj.id
|
||||
except exc.InternalError as ex:
|
||||
return six.text_type(ex)
|
||||
|
@ -554,6 +556,9 @@ class ServerProfile(base.Profile):
|
|||
if net:
|
||||
try:
|
||||
net_obj = nc.network_get(net)
|
||||
if net_obj is None:
|
||||
return _("The floating network %s could not be found."
|
||||
) % net
|
||||
result[self.FLOATING_NETWORK] = net_obj.id
|
||||
except exc.InternalError as ex:
|
||||
return six.text_type(ex)
|
||||
|
|
Loading…
Reference in New Issue