From c6687b6a1e6778091f1ca0098730fa0f6e2ebae5 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Mon, 4 Jul 2016 23:43:59 -0700 Subject: [PATCH] Admin utility: provide possible teaming values Output the possible teaming values TrivialFix Change-Id: I886cf7b6e4767f413af4d1f308da1e7d3c778956 --- .../shell/admin/plugins/nsxv/resources/networks.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py index 819f162d96..3ce7cf1759 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py @@ -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=")) LOG.info(_LI("Current switch value is: %s"), switch) + LOG.error(_LE("Invalid teaming policy. " + "Add --property teamingpolicy=")) + LOG.error(_LE("Possible values: %s"), ', '.join(supported_policies)) registry.subscribe(neutron_list_networks,