import os
+
import click
+
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_clean as os_clean
import functest.utils.openstack_snapshot as os_snapshot
-import yaml
-
-with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f:
- functest_yaml = yaml.safe_load(f)
+functest_yaml = ft_utils.get_functest_yaml()
-REPOS_DIR = os.getenv('repos_dir')
-FUNCTEST_REPO = ("%s/functest/" % REPOS_DIR)
FUNCTEST_CONF_DIR = functest_yaml.get("general").get(
"directories").get("dir_functest_conf")
RC_FILE = os.getenv('creds')
def check(self):
self.ping_endpoint()
- cmd = FUNCTEST_REPO + "ci/check_os.sh"
+ cmd = ft_utils.FUNCTEST_REPO + "/ci/check_os.sh"
ft_utils.execute_command(cmd, verbose=False)
def snapshot_create(self):
def snapshot_show(self):
if not os.path.isfile(OS_SNAPSHOT_FILE):
click.echo("There is no OpenStack snapshot created. To create "
- "one run the command 'functest env os-create-snapshot'")
+ "one run the command "
+ "'functest openstack snapshot-create'")
return
with open(OS_SNAPSHOT_FILE, 'r') as yaml_file:
click.echo("\n%s"
if not os.path.isfile(OS_SNAPSHOT_FILE):
click.echo("Not possible to clean OpenStack without a snapshot. "
"This could cause problems. "
- "Run first the command 'os-create-shapshot'.")
+ "Run first the command "
+ "'functest openstack snapshot-create'")
return
os_clean.main()