* `Exception.message` is deprecated.
* Use relative imports.
* `filter` returns an iterator in Py3
* `urlparse` moved.
* `s/log.warn/log.warning`
* Dockerfile: install Py3 versions.
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
-from module import OrchestratorCli
+from .module import OrchestratorCli
except NoOrchestrator:
return -errno.ENODEV, "", "No orchestrator configured"
except ImportError as e:
- return -errno.ENOENT, "", e.message
+ return -errno.ENOENT, "", str(e)
except NotImplementedError:
return -errno.EINVAL, "", "Command not found"
-from module import *
+from .module import *
-from module import RookOrchestrator
+from .module import RookOrchestrator
client = None
config = None
-from rook_cluster import RookCluster, ApplyException
+from .rook_cluster import RookCluster
all_completions = []
global all_completions
self.wait(all_completions)
- all_completions = filter(lambda x: not x.is_complete,
- all_completions)
+ all_completions = [c for c in all_completions if not c.is_complete]
self._shutdown.wait(5)
This module is runnable outside of ceph-mgr, useful for testing.
"""
-import urlparse
+from six.moves.urllib import parse
import logging
import json
ROOK_SYSTEM_NS,
label_selector=label_selector)
except ApiException as e:
- log.warn("Failed to fetch device metadata: {0}".format(e))
+ log.warning("Failed to fetch device metadata: {0}".format(e))
raise
nodename_to_devices = {}
"clusters/{0}".format(self.cluster_name),
body=patch)
except ApiException as e:
- log.exception("API exception: {0}".format(e.message))
+ log.exception("API exception: {0}".format(e))
raise ApplyException(
"Failed to create OSD entries in Cluster CRD: {0}".format(
- e.message))
+ e))
RUN (grep -q rhel /etc/os-release && ( \
yum install -y python-pip && \
yum install -y liboath && \
- yum install -y python-bcrypt librdmacm \
+ yum install -y python-bcrypt librdmacm && \
+ pip install kubernetes==6.0.0 \
)) || (grep -q suse /etc/os-release && ( \
zypper --non-interactive --gpg-auto-import-keys install --no-recommends --auto-agree-with-licenses --replacefiles --details \
- python-pip \
+ python3-kubernetes \
liboauth-devel \
python-bcrypt \
lz4 \
libopenssl1_1 \
))
-
-RUN pip install kubernetes==6.0.0
-
ADD bin.tar.gz /usr/bin/
ADD lib.tar.gz /usr/lib64/