Admin utility: provide possible teaming values

Output the possible teaming values

TrivialFix

Change-Id: I886cf7b6e4767f413af4d1f308da1e7d3c778956
This commit is contained in:
Gary Kotton 2016-07-04 23:43:59 -07:00
parent f34d632397
commit c6687b6a1e
1 changed files with 7 additions and 3 deletions

View File

@ -72,8 +72,11 @@ def nsx_update_switch(resource, event, trigger, **kwargs):
except exceptions.ResourceNotFound:
LOG.error(_LE("DVS %s not found"), dvs_id)
return
supported_policies = ['ETHER_CHANNEL', 'LOADBALANCE_LOADBASED',
'LOADBALANCE_SRCID', 'LOADBALANCE_SRCMAC',
'FAILOVER_ORDER']
policy = properties.get('teamingpolicy')
if policy:
if policy in supported_policies:
if switch['teamingPolicy'] == policy:
LOG.info(_LI("Policy already set!"))
return
@ -93,9 +96,10 @@ def nsx_update_switch(resource, event, trigger, **kwargs):
LOG.info(_LI("Switch value after update: %s"), switch)
else:
LOG.error(_LE("No teaming policy set. "
"Add --property teamingpolicy=<policy>"))
LOG.info(_LI("Current switch value is: %s"), switch)
LOG.error(_LE("Invalid teaming policy. "
"Add --property teamingpolicy=<policy>"))
LOG.error(_LE("Possible values: %s"), ', '.join(supported_policies))
registry.subscribe(neutron_list_networks,