summaryrefslogtreecommitdiffstats
path: root/cns-libs/cnslibs/common/heketi_libs.py
diff options
context:
space:
mode:
Diffstat (limited to 'cns-libs/cnslibs/common/heketi_libs.py')
-rw-r--r--cns-libs/cnslibs/common/heketi_libs.py71
1 files changed, 5 insertions, 66 deletions
diff --git a/cns-libs/cnslibs/common/heketi_libs.py b/cns-libs/cnslibs/common/heketi_libs.py
index 4a001adc..3ebe91ee 100644
--- a/cns-libs/cnslibs/common/heketi_libs.py
+++ b/cns-libs/cnslibs/common/heketi_libs.py
@@ -1,18 +1,11 @@
-#!/usr/bin/python
-
-"""
- Description: Library for heketi BaseClass.
-"""
+from collections import OrderedDict
+import datetime
+import unittest
from glusto.core import Glusto as g
-import unittest
-import datetime
-from collections import OrderedDict
+
from cnslibs.common.exceptions import ExecutionError, ConfigError
-from cnslibs.common.heketi_ops import (setup_heketi_ssh_key,
- modify_heketi_executor,
- export_heketi_cli_server,
- hello_heketi,
+from cnslibs.common.heketi_ops import (hello_heketi,
heketi_volume_delete,
heketi_blockvolume_delete)
from cnslibs.common.openshift_ops import (oc_login, switch_oc_project,
@@ -41,9 +34,6 @@ class HeketiBaseClass(unittest.TestCase):
cls.ocp_master_node = cls.ocp_master_nodes[0]
cls.deployment_type = g.config['cns']['deployment_type']
- cls.executor = g.config['cns']['executor']
- cls.executor_user = g.config['cns']['executor_user']
- cls.executor_port = g.config['cns']['executor_port']
heketi_config = g.config['cns']['heketi_config']
cls.heketi_dc_name = heketi_config['heketi_dc_name']
@@ -159,54 +149,3 @@ class HeketiBaseClass(unittest.TestCase):
super(HeketiBaseClass, cls).tearDownClass()
msg = "Teardownclass: %s : %s" % (cls.__name__, cls.glustotest_run_id)
g.log.info(msg)
-
-
-class HeketiClientSetupBaseClass(HeketiBaseClass):
- """
- Class to setup heketi ssh keys, modify heketi executor and to export
- heketi cli server.
- """
-
- @classmethod
- def setUpClass(cls):
- """
- setUpClass of HeketiClientSetupBaseClass
- """
-
- super(HeketiClientSetupBaseClass, cls).setUpClass()
-
- if cls.deployment_type == "crs_heketi_outside_openshift":
- # setup heketi ssh keys, if setup is not done already
- conn = g.rpyc_get_connection(cls.heketi_client_node, user="root")
- if conn is None:
- raise ConfigError("Failed to get rpyc connection of heketi "
- "node %s" % cls.heket_client_node)
-
- if conn.modules.os.path.exists(cls.heketi_ssh_key):
- g.log.info("Heketi ssh key is already generated")
- else:
- if not setup_heketi_ssh_key(cls.heketi_client_node,
- cls.gluster_servers,
- heketi_ssh_key=cls.heketi_ssh_key):
- raise ConfigError("heketi ssh key setup failed on %s"
- % cls.heketi_client_node)
-
- g.rpyc_close_connection(cls.heketi_client_node, user="root")
-
- # Modifies heketi executor
- if not modify_heketi_executor(cls.heketi_client_node, cls.executor,
- cls.heketi_ssh_key,
- cls.executor_user,
- int(cls.executor_port)):
- raise ExecutionError("Failed to modify heketi executor on %s"
- % cls.heketi_client_node)
-
- # Exports heketi cli server
- heketi_url = cls.heketi_server_url
- if not export_heketi_cli_server(
- cls.heketi_client_node,
- heketi_cli_server=heketi_url,
- heketi_cli_user=cls.heketi_cli_user,
- heketi_cli_key=cls.heketi_cli_key):
- raise ExecutionError("Failed to export heketi cli server on %s"
- % cls.heketi_client_node)