3 # jose.lausuch@ericsson.com
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # pylint: disable=missing-docstring
18 class Env(object): # pylint: disable=too-few-public-methods
22 install_type = os.environ.get('INSTALLER_TYPE', 'Unknown')
23 installer_ip = os.environ.get('INSTALLER_IP', 'Unknown')
24 installer_info = ("%s, %s" % (install_type, installer_ip))
25 scenario = os.environ.get('DEPLOY_SCENARIO', 'Unknown')
26 node = os.environ.get('NODE_NAME', 'Unknown')
27 build_tag = os.environ.get('BUILD_TAG', None)
29 build_tag = build_tag.lstrip(
30 "jenkins-").lstrip("functest").lstrip("-")
32 env_info = {'INSTALLER': installer_info,
35 'BUILD_TAG': build_tag}
40 class CliEnv(object): # pylint: disable=too-few-public-methods
45 msg = prettytable.PrettyTable(
46 header_style='upper', padding_width=5,
47 field_names=['Functest Environment', 'value'])
48 for key, value in six.iteritems(env_info):
50 msg.add_row([key, value])
51 click.echo(msg.get_string())