From 1fa9910c1ba096d0e1c26fb9f3be417958c95d75 Mon Sep 17 00:00:00 2001 From: Tao Zou Date: Fri, 19 Jul 2024 17:04:13 +0800 Subject: [PATCH] Add tenant while get in update Add tenant while calling get in update Change-Id: I94e579264218fa456c84aedd916c1c2dec47f3d0 --- vmware_nsxlib/v3/policy/core_resources.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vmware_nsxlib/v3/policy/core_resources.py b/vmware_nsxlib/v3/policy/core_resources.py index c954c2b7..33f9e963 100644 --- a/vmware_nsxlib/v3/policy/core_resources.py +++ b/vmware_nsxlib/v3/policy/core_resources.py @@ -135,7 +135,8 @@ class NsxPolicyResourceBase(object, metaclass=abc.ABCMeta): """Helper for update function - ignore attrs without explicit value""" args = self._get_user_args(**kwargs) resource_def = self.entry_def(nsx_version=self.version, **args) - body = self.policy_api.get(resource_def) + tenant = args.get('tenant', constants.POLICY_INFRA_TENANT) + body = self.policy_api.get(resource_def, tenant) if body: resource_def.set_obj_dict(body)