Networking workflow now handles no-router case

The change introduced in I39acb068c89dd6e0f781147059641d0bc4f10e57 makes
the get-default-router-id command to assign "NOT_FOUND" if there is no router in the current tenant.
Now the workflow will properly handle this case and will properly halt.
Also, the router get reset to None afterwards, so subsequent deployments will succeed if the router is added.

Requires I39acb068c89dd6e0f781147059641d0bc4f10e57 to be merged

Change-Id: Idaee76dda7ea9c2b039e59abc1dd899f3e88b22e
Partial-Bug: #1261356
This commit is contained in:
ativelkov 2013-12-16 17:22:06 +04:00
parent c686a87aa2
commit f44821b4d8

View File

@ -9,13 +9,35 @@
<rule match="$[?(@.networking.topology == 'routed' and not @.networking.routerId)]"
desc="Router-based topology, need to detect router">
<get-default-router-id result="result">
<success>
<set path="networking.routerId"><select source="result" path="routerId"/></set>
<set path="networking.state.ready_for_cidrs"><true/></set>
<set path="networking.createNetwork"><true/></set>
</success>
</get-default-router-id>
<get-default-router-id result="result">
<success>
<set path="networking.routerId">
<select source="result" path="routerId"/>
</set>
<rule match="$[?(@.networking.routerId == 'NOT_FOUND')]"
desc="Router could not be found">
<report entity="environment" level="error">
<parameter name="id">
<select path="/id"/>
</parameter>
<parameter name="text">Unable to configure network: the tenant does not have a Router. Please, create a router in the current tenant</parameter>
</report>
<set path="networking.routerId">
<null/>
</set>
<stop/>
<empty>
<set path="networking.state.ready_for_cidrs">
<true/>
</set>
<set path="networking.createNetwork">
<true/>
</set>
</empty>
</rule>
</success>
</get-default-router-id>
</rule>
<rule match="$[?(@.networking.topology == 'flat' and not @.networking.networks)]"