Import openshift_client optionally
Even if openshift_client is in the requirements of Tobiko, let's not fail if this lib is not available Change-Id: I4bb24aa7b620f1d73ceabda1e56e8e0608fb3a2e
This commit is contained in:
parent
46a1868f6f
commit
952d238d15
@ -14,7 +14,6 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import netaddr
|
||||
import openshift_client as oc
|
||||
from oslo_log import log
|
||||
|
||||
import tobiko
|
||||
@ -40,6 +39,11 @@ EDPM_OTHER_GROUP = 'edpm-other'
|
||||
_IS_OC_CLIENT_AVAILABLE = None
|
||||
_IS_BM_CRD_AVAILABLE = None
|
||||
|
||||
try:
|
||||
import openshift_client as oc
|
||||
except ModuleNotFoundError:
|
||||
_IS_OC_CLIENT_AVAILABLE = False
|
||||
|
||||
|
||||
def _is_oc_client_available() -> bool:
|
||||
# pylint: disable=global-statement
|
||||
|
Loading…
x
Reference in New Issue
Block a user