summaryrefslogtreecommitdiffstats
path: root/openshift-storage-libs
diff options
context:
space:
mode:
authorNitin Goyal <nigoyal@redhat.com>2019-09-19 10:59:28 +0530
committervamahaja <vamahaja@redhat.com>2019-10-10 17:34:10 +0530
commit3f426edceec3b33976bb3c00d7bc63ee0de3cbfb (patch)
treedb0a43a96ac12f5fff4d4a44898b66fecd702fde /openshift-storage-libs
parent6d319cdec377dda3f0d49001a8d53c879bd43206 (diff)
Add new library heketi_node_remove
Change-Id: I96759bbcd74cad7755c99255b4b96261133d5adc
Diffstat (limited to 'openshift-storage-libs')
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/heketi_ops.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/heketi_ops.py b/openshift-storage-libs/openshiftstoragelibs/heketi_ops.py
index fb87237..98c5154 100644
--- a/openshift-storage-libs/openshiftstoragelibs/heketi_ops.py
+++ b/openshift-storage-libs/openshiftstoragelibs/heketi_ops.py
@@ -839,6 +839,40 @@ def heketi_node_delete(heketi_client_node, heketi_server_url, node_id,
return out
+def heketi_node_remove(heketi_client_node, heketi_server_url, node_id,
+ **kwargs):
+ """Executes heketi node remove command.
+
+ Args:
+ heketi_client_node (str): Node on which cmd has to be executed.
+ heketi_server_url (str): Heketi server url
+ node_id (str): Node id to remove node
+
+ Kwargs:
+ The keys, values in kwargs are:
+ - secret : (str)|None
+ - user : (str)|None
+
+ Returns:
+ str: heketi node remove command output on success.
+
+ Raises:
+ AssertionError: if command fails.
+
+ Example:
+ heketi_node_remove(heketi_client_node, heketi_server_url, node_id)
+ """
+
+ heketi_server_url, json_arg, admin_key, user = _set_heketi_global_flags(
+ heketi_server_url, **kwargs)
+
+ cmd = "heketi-cli -s %s node remove %s %s %s" % (
+ heketi_server_url, node_id, admin_key, user)
+ cmd = TIMEOUT_PREFIX + cmd
+ out = heketi_cmd_run(heketi_client_node, cmd)
+ return out
+
+
def heketi_node_disable(heketi_client_node, heketi_server_url, node_id,
**kwargs):
"""Executes heketi node disable command.