Proper handling of "No default router" case
If no router is detected, the command will return NOT_FOUND instead of None. The reason for this is that if networking.routerId is assigned to None, the workflow will attempt to detect it again and again which causes the workflow to freeze (launchpad bug #1261356). Now the command returns NOT_FOUND instead of None. Workflow now will be able to handle this NOT_FOUND constant to properly interrupt the execution and report an error. This is a workaround: proper (and longer) fix will require to either fail with exception (which then should be properly handled in the failure block) or create a router manually. This will be addressed later in 0.4.1. Currently there is no way to properly handle exception sin networking commands, so scenarios which uses failure blocks are not applicable, so the handling should be done in success method of the command Partial-Bug: #1261356 Change-Id: I39acb068c89dd6e0f781147059641d0bc4f10e57
This commit is contained in:
parent
20f68e8496
commit
897b391221
@ -107,7 +107,7 @@ class NeutronExecutor(CommandBase):
|
||||
routers = self.neutron.list_routers(tenant_id=self.tenant_id). \
|
||||
get("routers")
|
||||
if not len(routers):
|
||||
routerId = None
|
||||
routerId = "NOT_FOUND"
|
||||
else:
|
||||
routerId = routers[0]["id"]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user