From a9b7d770c3c7796ac5ae818cc48474be9b10c4fc Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Thu, 3 Oct 2019 10:31:40 +0300 Subject: [PATCH] Add exception for vlan conflicts Change-Id: Iba543fd3ad4eac1f81df1d0b343306c60269fa8e --- vmware_nsxlib/v3/client.py | 1 + vmware_nsxlib/v3/exceptions.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/vmware_nsxlib/v3/client.py b/vmware_nsxlib/v3/client.py index 3f18c700..85443d4c 100644 --- a/vmware_nsxlib/v3/client.py +++ b/vmware_nsxlib/v3/client.py @@ -37,6 +37,7 @@ def http_error_to_exception(status_code, error_code): requests.codes.BAD_REQUEST: {'60508': exceptions.NsxIndexingInProgress, '60514': exceptions.NsxSearchTimeout, + '8327': exceptions.NsxOverlapVlan, '500045': exceptions.NsxPendingDelete, '500030': exceptions.ResourceInUse, '500105': exceptions.NsxOverlapAddresses, diff --git a/vmware_nsxlib/v3/exceptions.py b/vmware_nsxlib/v3/exceptions.py index 4fe0cab4..085f83ad 100644 --- a/vmware_nsxlib/v3/exceptions.py +++ b/vmware_nsxlib/v3/exceptions.py @@ -211,6 +211,11 @@ class NsxOverlapAddresses(NsxLibInvalidInput): message = _("Overlapping addresses found: %(details)s") +class NsxOverlapVlan(NsxLibInvalidInput): + message = _("Duplicate logical-switch vlan-ids sharing same underlying " + "physical devices resulting in a conflict") + + class APITransactionAborted(ServerBusy): message = _("API transaction aborted as MP cluster is reconfiguring")