diff options
author | Bin Yang <bin.yang@windriver.com> | 2020-02-28 12:38:02 +0800 |
---|---|---|
committer | Bin Yang <bin.yang@windriver.com> | 2020-02-28 15:05:49 +0800 |
commit | 890c369ab3128ee8bac921c3bf2be6961583db7d (patch) | |
tree | 89185cb3c2c652c8cce23e75910d99b3160dc06c /share/starlingx_base/registration | |
parent | d41752458f677c7c1c5cd9b5a9c4af1990d116e8 (diff) |
Wrap infra_workload API call to k8s plugin
Create profile during post API
Change-Id: Ia68eb34f4c1baf01ad96aaaf6b4147a78374de60
Issue-ID: MULTICLOUD-1003
Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'share/starlingx_base/registration')
-rw-r--r-- | share/starlingx_base/registration/registration.py | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/share/starlingx_base/registration/registration.py b/share/starlingx_base/registration/registration.py index 73c9be18..4d5e1f3d 100644 --- a/share/starlingx_base/registration/registration.py +++ b/share/starlingx_base/registration/registration.py @@ -473,31 +473,15 @@ class RegistryHelper(newton_registration.RegistryHelper): try: cloud_extra_info = viminfo.get("cloud_extra_info_json",{}) - vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) - - # check system version of starlingx - system_info = cloud_extra_info.get("isystem", {}) - systemversion = system_info.get("software_version", None) - if not systemversion: - self._logger.warn("query system version fails") - return - # check if a k8s platform - is_k8s_cluster = False - # check WRCP versions: - if systemversion == "19.12": - is_k8s_cluster = True - elif systemversion == "19.10": - is_k8s_cluster = True - - if not is_k8s_cluster: - self._logger.info("%s, %s is not a k8s platform, system version: %s" - % (cloud_owner, cloud_region_id, systemversion)) + if VimDriverUtils.check_k8s_cluster(viminfo): + self._logger.info("%s, %s is not a k8s platform" + % (cloud_owner, cloud_region_id)) return # check if user token provided to access k8s platform - k8s_apitoken = cloud_extra_info.get("k8s-apitoken", None) - k8s_apiserver = cloud_extra_info.get("k8s-apiserver", None) + k8s_apitoken = cloud_extra_info.get("k8s-apitoken") + k8s_apiserver = cloud_extra_info.get("k8s-apiserver") if not k8s_apitoken or not k8s_apiserver: self._logger.warn("k8s-apitoken or k8s-apiserver is not provided,"\ "k8s connectivity must be provisioned in other ways") |