Admin Utility: Minor fixes for output formatting

Change-Id: I77913904f2e937797e2d7f61123dd1c4a45144f9
This commit is contained in:
Amey Bhide 2015-12-08 13:32:20 -08:00
parent ec68daecc3
commit f9cae85f78
2 changed files with 13 additions and 3 deletions

View File

@ -14,6 +14,7 @@
import logging
import pprint
from tools.python_nsxadmin.admin.plugins.common import constants
import tools.python_nsxadmin.admin.plugins.common.utils as admin_utils
@ -81,8 +82,13 @@ def list_missing_dhcp_bindings(resource, event, trigger, **kwargs):
len(neutron_dhcp_static_bindings))
LOG.info(_LI("# of DHCP bindings on NSXv backend: %s"),
len(nsx_dhcp_static_bindings))
LOG.info(_LI("Missing DHCP bindings:"))
LOG.info(neutron_dhcp_static_bindings - nsx_dhcp_static_bindings)
missing = neutron_dhcp_static_bindings - nsx_dhcp_static_bindings
if not missing:
LOG.info(_LI("No missing DHCP bindings found."))
LOG.info(_LI("Neutron DB and NSXv backend are in sync"))
else:
LOG.info(_LI("Missing DHCP bindings:"))
LOG.info(_LI("%s"), pprint.pformat(missing))
@admin_utils.output_header

View File

@ -23,6 +23,7 @@ import tools.python_nsxadmin.admin.plugins.nsxv.resources.utils as utils
import tools.python_nsxadmin.admin.shell as shell
from neutron.callbacks import registry
from neutron.common import exceptions
from vmware_nsx._i18n import _LE, _LI
from vmware_nsx.db import nsxv_db
@ -129,7 +130,10 @@ def nsx_update_edge(resource, event, trigger, **kwargs):
ha_request = {
'featureType': 'highavailability_4.0',
'enabled': ha}
return nsxv.enable_ha(properties.get('edge-id'), ha_request, async=False)
try:
nsxv.enable_ha(properties.get('edge-id'), ha_request, async=False)
except exceptions.NeutronException as e:
LOG.error(_LE("%s"), str(e))
registry.subscribe(nsx_list_edges,