aboutsummaryrefslogtreecommitdiffstats
path: root/functest/cli/commands/cli_os.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-02-27 14:25:49 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2018-02-27 14:27:57 +0100
commitbaa8f2d5f67d45e5761f92cb93fe22050f08d0fe (patch)
tree05ddb33dc893cad35369b3286db944eac79ffe4d /functest/cli/commands/cli_os.py
parent53cd7f8176c996014decb7311d9f546f6b8f2497 (diff)
Clean all OpenStack related modules
Xtesting is only focused on the framework and entry points. Change-Id: I1a4146ed8519438b13810a20ddf1140c35bb6ecd Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/cli/commands/cli_os.py')
-rw-r--r--functest/cli/commands/cli_os.py63
1 files changed, 0 insertions, 63 deletions
diff --git a/functest/cli/commands/cli_os.py b/functest/cli/commands/cli_os.py
deleted file mode 100644
index d3e229c8..00000000
--- a/functest/cli/commands/cli_os.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-#
-# jose.lausuch@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# pylint: disable=missing-docstring
-
-import os
-
-import click
-from six.moves import urllib
-
-from functest.ci import check_deployment
-from functest.utils import constants
-
-
-class OpenStack(object):
-
- def __init__(self):
- self.os_auth_url = os.environ.get('OS_AUTH_URL', None)
- self.endpoint_ip = None
- self.endpoint_port = None
- self.openstack_creds = constants.ENV_FILE
- if self.os_auth_url:
- self.endpoint_ip = urllib.parse.urlparse(self.os_auth_url).hostname
- self.endpoint_port = urllib.parse.urlparse(self.os_auth_url).port
-
- def ping_endpoint(self):
- if self.os_auth_url is None:
- click.echo("Source the OpenStack credentials first")
- exit(0)
- response = os.system("ping -c 1 " + self.endpoint_ip + ">/dev/null")
- if response == 0:
- return 0
- else:
- click.echo("Cannot talk to the endpoint %s\n" % self.endpoint_ip)
- exit(0)
-
- @staticmethod
- def show_credentials():
- dic_credentials = {}
- for key, value in os.environ.items():
- if key.startswith('OS_'):
- dic_credentials.update({key: value})
- return dic_credentials
-
- def check(self):
- self.ping_endpoint()
- deployment = check_deployment.CheckDeployment()
- deployment.check_all()
-
-
-class CliOpenStack(OpenStack):
-
- @staticmethod
- def show_credentials():
- dic_credentials = OpenStack.show_credentials()
- for key, value in dic_credentials.items():
- if key.startswith('OS_'):
- click.echo("{}={}".format(key, value))