diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index 74d1c5affc..f257de007c 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -203,6 +203,7 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, router=l3_db_models.Router, floatingip=l3_db_models.FloatingIP) def __init__(self): + nsxlib_utils.set_is_attr_callback(validators.is_attr_set) self._extend_fault_map() self._extension_manager = managers.ExtensionManager() super(NsxV3Plugin, self).__init__() @@ -297,6 +298,8 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, nsx_lib_exc.ClientCertificateNotTrusted: webob.exc.HTTPBadRequest, nsx_exc.SecurityGroupMaximumCapacityReached: + webob.exc.HTTPBadRequest, + nsx_lib_exc.NsxLibInvalidInput: webob.exc.HTTPBadRequest}) def _init_fwaas(self, resource, event, trigger, **kwargs): diff --git a/vmware_nsx/shell/admin/plugins/nsxv3/resources/certificates.py b/vmware_nsx/shell/admin/plugins/nsxv3/resources/certificates.py index d1ec6df12a..c30e000daa 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv3/resources/certificates.py +++ b/vmware_nsx/shell/admin/plugins/nsxv3/resources/certificates.py @@ -21,11 +21,11 @@ from vmware_nsx.shell.admin.plugins.common import utils as admin_utils from vmware_nsx.shell.admin.plugins.nsxv3.resources import utils from vmware_nsx.shell import resources as shell from vmware_nsxlib.v3 import client_cert +from vmware_nsxlib.v3 import exceptions from vmware_nsxlib.v3 import trust_management from neutron_lib.callbacks import registry from neutron_lib import context -from neutron_lib import exceptions from oslo_config import cfg LOG = logging.getLogger(__name__) @@ -121,7 +121,7 @@ def generate_cert(resource, event, trigger, **kwargs): try: cert.generate(subject, key_size, valid_for_days, signature_alg) - except exceptions.InvalidInput as e: + except exceptions.NsxLibInvalidInput as e: LOG.info(e) return