Browse Source

passthrough config copy fix

Providers did not implemet specific __deepcopy__ methods so for now use regular
copy for those.

Change-Id: I68a727a7b774d9c38f7d1cda633a85b9d096af92
tags/16.0.3^0
asarfaty 3 weeks ago
committed by Adit Sarfaty
parent
commit
6f2c89c618
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      vmware_nsxlib/v3/policy/__init__.py

+ 7
- 0
vmware_nsxlib/v3/policy/__init__.py View File

@@ -45,6 +45,13 @@ class NsxPolicyLib(lib.NsxLibBase):
config = copy.deepcopy(self.nsxlib_config)
# X-Allow-Overwrite must be set for passthrough apis
config.allow_overwrite_header = True
# Manually copy providers (No deep copy, as those are instances)
# FIXME(asarfaty): This can be handled nicer by adding
# __deepcopy__ methods to the provider classes to do the deepcopy
# correctly
config.token_provider = self.nsxlib_config.token_provider
config.client_cert_provider = (
self.nsxlib_config.client_cert_provider)
self.nsx_api = v3.NsxLib(config)
else:
self.nsx_api = None


Loading…
Cancel
Save