[gce] ex_create_network can have NoneType routing_mode
Check for that before trying string operations on it.
@@ -3892,9 +3892,10 @@ class GCENodeDriver(NodeDriver):
else:
network_data['autoCreateSubnetworks'] = (mode.lower() == 'auto')
+ if routing_mode:
if routing_mode.lower() not in ['regional', 'global']:
- raise ValueError("Invalid Routing Mode: '%s'. Must be 'REGIONAL', "
- "or 'GLOBAL'." % routing_mode)
+ raise ValueError("Invalid Routing Mode: '%s'. Must be "
+ "'REGIONAL', or 'GLOBAL'." % routing_mode)
else:
network_data['routingConfig'] = {
'routingMode': routing_mode.upper()
