From 62b241e052649e61d83703ab4f1194964463109e Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Thu, 31 Aug 2017 14:36:07 +0300 Subject: [PATCH] Add the nsxlib to all NsxLibApiBase resources This will allow all resources to use the nsxlib services, like feature_supported Change-Id: I595954e18af9dd386a62e4247108627f86456e8b --- vmware_nsxlib/v3/__init__.py | 17 +++++++++-------- vmware_nsxlib/v3/security.py | 6 ++++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/vmware_nsxlib/v3/__init__.py b/vmware_nsxlib/v3/__init__.py index 249c4e48..7f91b8a4 100644 --- a/vmware_nsxlib/v3/__init__.py +++ b/vmware_nsxlib/v3/__init__.py @@ -221,25 +221,26 @@ class NsxLib(NsxLibBase): self.native_md_proxy = core_resources.NsxLibMetadataProxy( self.client, self.nsxlib_config, nsxlib=self) self.firewall_section = security.NsxLibFirewallSection( - self.client, self.nsxlib_config) + self.client, self.nsxlib_config, nsxlib=self) self.ns_group = security.NsxLibNsGroup( - self.client, self.nsxlib_config, self.firewall_section) + self.client, self.nsxlib_config, self.firewall_section, + nsxlib=self) self.native_dhcp = native_dhcp.NsxLibNativeDhcp( - self.client, self.nsxlib_config) + self.client, self.nsxlib_config, nsxlib=self) self.ip_block_subnet = core_resources.NsxLibIpBlockSubnet( self.client, self.nsxlib_config, nsxlib=self) self.ip_block = core_resources.NsxLibIpBlock( self.client, self.nsxlib_config, nsxlib=self) self.ip_set = security.NsxLibIPSet( - self.client, self.nsxlib_config) + self.client, self.nsxlib_config, nsxlib=self) self.logical_port = resources.LogicalPort( - self.client, self.nsxlib_config) + self.client, self.nsxlib_config, nsxlib=self) self.logical_router_port = resources.LogicalRouterPort( - self.client, self.nsxlib_config) + self.client, self.nsxlib_config, nsxlib=self) self.dhcp_server = resources.LogicalDhcpServer( - self.client, self.nsxlib_config) + self.client, self.nsxlib_config, nsxlib=self) self.ip_pool = resources.IpPool( - self.client, self.nsxlib_config) + self.client, self.nsxlib_config, nsxlib=self) self.load_balancer = load_balancer.LoadBalancer( self.client, self.nsxlib_config) diff --git a/vmware_nsxlib/v3/security.py b/vmware_nsxlib/v3/security.py index 95742c55..d939314b 100644 --- a/vmware_nsxlib/v3/security.py +++ b/vmware_nsxlib/v3/security.py @@ -35,9 +35,11 @@ MAX_NSGROUPS_CRITERIA_TAGS = 10 class NsxLibNsGroup(utils.NsxLibApiBase): - def __init__(self, client, max_attempts, firewall_section_handler): + def __init__(self, client, nsxlib_config, firewall_section_handler, + nsxlib=None): self.firewall_section = firewall_section_handler - super(NsxLibNsGroup, self).__init__(client, max_attempts) + super(NsxLibNsGroup, self).__init__(client, nsxlib_config, + nsxlib=nsxlib) def update_on_backend(self, context, security_group, nsgroup_id, section_id,