Move to python version 3 in all scripts for kubernetes environment.
Streamline file names to match existing libraries.
Signed-off-by: Yury Kylulin <yury.kylulin@intel.com>
Change-Id: Id875f4240a87ab600b445cb9a7fd97ec1335f88a
-#!/usr/bin/env python2.7
##
## Copyright (c) 2019 Intel Corporation
##
## Copyright (c) 2019 Intel Corporation
-from k8sdeployment import K8sDeployment
+from rapid_k8s_deployment import K8sDeployment
# Config file name for deployment creation
CREATE_CONFIG_FILE_NAME = "rapid.pods"
# Config file name for deployment creation
CREATE_CONFIG_FILE_NAME = "rapid.pods"
-#!/usr/bin/env python2.7
-
##
## Copyright (c) 2019-2020 Intel Corporation
##
##
## Copyright (c) 2019-2020 Intel Corporation
##
import sys
from kubernetes import client, config
import sys
from kubernetes import client, config
+try:
+ import configparser
+except ImportError:
+ # Python 2.x fallback
+ import ConfigParser as configparser
import logging
from logging import handlers
import logging
from logging import handlers
+from rapid_k8s_pod import Pod
class K8sDeployment:
"""Deployment class to create containers for test execution in Kubernetes
class K8sDeployment:
"""Deployment class to create containers for test execution in Kubernetes
"""Read and parse configuration file for the test environment.
"""
self._log.info("Loading configuration file %s", config_file_name)
"""Read and parse configuration file for the test environment.
"""
self._log.info("Loading configuration file %s", config_file_name)
- self._create_config = ConfigParser.RawConfigParser()
+ self._create_config = configparser.RawConfigParser()
try:
self._create_config.read(config_file_name)
except Exception as e:
try:
self._create_config.read(config_file_name)
except Exception as e:
def save_runtime_config(self, config_file_name):
self._log.info("Saving config %s for runrapid script...",
config_file_name)
def save_runtime_config(self, config_file_name):
self._log.info("Saving config %s for runrapid script...",
config_file_name)
- self._runtime_config = ConfigParser.RawConfigParser()
+ self._runtime_config = configparser.RawConfigParser()
# Section [DEFAULT]
# self._runtime_config.set("DEFAULT",
# Section [DEFAULT]
# self._runtime_config.set("DEFAULT",
-#!/usr/bin/env python2.7
-
##
## Copyright (c) 2019 Intel Corporation
##
##
## Copyright (c) 2019 Intel Corporation
##
import logging
from kubernetes import client, config
import logging
from kubernetes import client, config
-from sshclient import SSHClient
+from rapid_sshclient import SSHClient
class Pod:
"""Class which represents test pods.
class Pod:
"""Class which represents test pods.
-#!/usr/bin/env python2.7
-
##
## Copyright (c) 2019 Intel Corporation
##
##
## Copyright (c) 2019 Intel Corporation
##