diff options
author | Bin Yang <bin.yang@windriver.com> | 2019-04-01 09:46:31 +0000 |
---|---|---|
committer | Bin Yang <bin.yang@windriver.com> | 2019-04-01 09:46:31 +0000 |
commit | 3176e57da097f2c238b134f18b1a4af00e105546 (patch) | |
tree | 66301d35a32927feed1fc277a3d06bb8eb87786b /share/starlingx_base/registration/registration.py | |
parent | 4a7181a20f5eb9ad6bfbcb0945fa79ac0ddd620b (diff) |
Update capacity check API
Query the AZinfo from the cache
Relay on the background thread of AZcap Auditing
Change-Id: I064dbc22c71ef25683145ef1c96274ce6ac74c3b
Issue-ID: MULTICLOUD-542
Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'share/starlingx_base/registration/registration.py')
-rw-r--r-- | share/starlingx_base/registration/registration.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/share/starlingx_base/registration/registration.py b/share/starlingx_base/registration/registration.py index 7a85b29f..59074568 100644 --- a/share/starlingx_base/registration/registration.py +++ b/share/starlingx_base/registration/registration.py @@ -373,7 +373,8 @@ class InfraResourceAuditor(newton_registration.RegistryHelper): continue hypervisors_dict[h["hypervisor_hostname"]] = h - az_pserver_info = {} + vimAzCacheKey = "cap_azlist_" + vimid + vimAzList = [] # cloud_owner, cloud_region_id = extsys.decode_vim_id(vimid) for az in self._get_list_resources( "/os-availability-zone/detail", "compute", session, @@ -393,6 +394,8 @@ class InfraResourceAuditor(newton_registration.RegistryHelper): if azName == 'internal': continue + vimAzList.append(azName) + # get list of host names pservers_info = [k for (k, v) in az['hosts'].items()] # set the association between az and pservers @@ -456,6 +459,7 @@ class InfraResourceAuditor(newton_registration.RegistryHelper): # update the cache cache.set(azCapCacheKey, json.dumps(azCapInfoCache), 3600 * 24) + cache.set(vimAzCacheKey, vimAzList, 3600 * 24) except Exception as e: self._logger.error("azcap_audit raise exception: %s" % e) pass |