Esempio n. 1
0
    def generate_json(self):
        report_obj = {}
        report_obj['version'] = \
            version.VersionInfo('dovetail').version_string()

        report_obj['testsuite'] = self.runner.name
        report_obj['dashboard'] = None
        report_obj['build_tag'] = self.runner.build_tag
        report_obj['upload_date'] =\
            datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
        report_obj['duration'] = self.runner.end - self.runner.start

        report_obj['testcases_list'] = []
        for testcase_name in self.runner.testcases:
            testcase_runner = self.runner.get_testcase_runner(testcase_name)
            testcase_inreport = {}
            testcase_inreport['name'] = testcase_name
            if not testcase_runner:
                testcase_inreport['result'] = 'Undefined'
                testcase_inreport['objective'] = ''
                testcase_inreport['sub_testcase'] = []
                report_obj['testcases_list'].append(testcase_inreport)
                continue

            testcase_inreport['result'] = testcase_runner.result.get(
                'criteria')
            testcase_inreport['objective'] = testcase_runner.conf.get(
                'objective')
            testcase_inreport['sub_testcase'] = []
            report_obj['testcases_list'].append(testcase_inreport)
        return report_obj
Esempio n. 2
0
 def __init__(self):
     super(Main, self).__init__(
         description='Tempest cli application',
         version=version.VersionInfo('tempest').version_string(),
         command_manager=commandmanager.CommandManager('tempest.cm'),
         deferred_help=True,
     )
Esempio n. 3
0
 def __init__(self):
     super(ParserMainApp, self).__init__(
         description='Dlux CLI to parse a file into a different format.',
         version=vr.VersionInfo('dluxparser').version_string_with_vcs(),
         command_manager=commandmanager.CommandManager('dluxparser.cm'),
         deferred_help=True,
         )
Esempio n. 4
0
 def __init__(self):
     super(Main, self).__init__(
         description="A Benchmarking and Performance Analysis Framework",
         version=version.VersionInfo('pbench').version_string_with_vcs(),
         command_manager=commandmanager.CommandManager('pbench.cm'),
         deferred_help=True,
     )
Esempio n. 5
0
 def __init__(self):
     super(KanboardShell, self).__init__(
         description='Kanboard Command Line Client',
         version=app_version.VersionInfo('kanboard_cli').version_string(),
         command_manager=commandmanager.CommandManager('kanboard.cli'),
         deferred_help=True)
     self.client = None
     self.is_super_user = True
Esempio n. 6
0
 def __init__(self, **kwargs):
     super(FuelBootstrap, self).__init__(
         description='Command line Fuel bootstrap manager',
         version=version.VersionInfo('fuel-bootstrap').version_string(),
         command_manager=CommandManager('fuel_bootstrap',
                                        convert_underscores=True),
         **kwargs
     )
Esempio n. 7
0
def setup_logging():

    logging.setup(CONF, 'kuryr-kubernetes')
    logging.set_defaults(default_log_levels=logging.get_default_log_levels())
    version_k8s = pbr_version.VersionInfo('kuryr-kubernetes').version_string()
    LOG.info(_LI("Logging enabled!"))
    LOG.info(_LI("%(prog)s version %(version)s"), {
        'prog': sys.argv[0],
        'version': version_k8s
    })
Esempio n. 8
0
 def test_get_db_status_success_er_green(self, status_check_mock, er_mock):
     expected_response = {'status': {
         'availability': {
             'database': True,
             'elastic-recheck': {'Configured': {'elastic-search': 'green'}}
         },
         'version': version.VersionInfo(
             'openstack_health').version_string_with_vcs()
     }}
     response = self.app.get('/status')
     self.assertEqual(response.status_code, 200)
     output = json.loads(response.data.decode('utf-8'))
     self.assertEqual(output, expected_response)
Esempio n. 9
0
 def test_get_status_failure_er_not_installed(self, status_check_mock,
                                              er_mock):
     expected_response = {'status': {
         'availability': {
             'database': False,
             'elastic-recheck': 'NotInstalled'
         },
         'version': version.VersionInfo(
             'openstack_health').version_string_with_vcs()
     }}
     response = self.app.get('/status')
     self.assertEqual(response.status_code, 500)
     self.assertEqual(json.loads(response.data.decode('utf-8')),
                      expected_response)
Esempio n. 10
0
def main():
    """Main cli entry point for distributing cli commands."""
    args = docopt.docopt(__doc__,
                         options_first=True,
                         version=version.VersionInfo('ospt').release_string())
    cmd_name = args.pop('<command>')
    cmd_args = args.pop('<args>')

    cmd_class = commands.CMD_DICT.get(cmd_name, None)
    if cmd_class is None:
        raise docopt.DocoptExit(
            message="Not supported command: {}".format(cmd_name))

    cmd_args = [cmd_name] + cmd_args
    cmd = cmd_class(cmd_args, args)
    return cmd.do()
Esempio n. 11
0
def inject_common_paths():
    """Discover the path to the common/ directory provided by infrared core."""
    def override_conf_path(common_path, envvar, specific_dir):
        conf_path = os.environ.get(envvar, '')
        additional_conf_path = os.path.join(common_path, specific_dir)
        if conf_path:
            full_conf_path = ':'.join([additional_conf_path, conf_path])
        else:
            full_conf_path = additional_conf_path
        os.environ[envvar] = full_conf_path

    version_info = version.VersionInfo('infrared')

    common_path = pkg.resource_filename(version_info.package, 'common')
    override_conf_path(common_path, 'ANSIBLE_ROLES_PATH', 'roles')
    override_conf_path(common_path, 'ANSIBLE_FILTER_PLUGINS', 'filter_plugins')
    override_conf_path(common_path, 'ANSIBLE_CALLBACK_PLUGINS',
                       'callback_plugins')
    override_conf_path(common_path, 'ANSIBLE_LIBRARY', 'library')
Esempio n. 12
0
def detect_from_metadata(package):
    """
    Detect a package version number from the metadata.

    If the version number cannot be detected, the function returns 0.

    :param str package: package name
    :returns str: the package version number.
    """
    try:
        try:
            version_info = version.VersionInfo(package)
            package_version = version_info.release_string()
        except (ModuleNotFoundError, pkg_resources.DistributionNotFound):
            distribution_info = pkg_resources.get_distribution(package)
            package_version = distribution_info.version
    except Exception:
        package_version = 0

    return package_version
Esempio n. 13
0
def get_status():

    is_db_available = _check_db_availability()
    is_er_available = _check_er_availability()

    status = {
        'status': {
            'availability': {
                'database': is_db_available,
                'elastic-recheck': is_er_available,
            },
            'version':
            version.VersionInfo('openstack_health').version_string_with_vcs()
        }
    }
    response = jsonify(status)

    if not is_db_available:
        response.status_code = 500

    return response
Esempio n. 14
0
    def generate_json(cls, testcase_list, duration):
        report_obj = {}
        report_obj['version'] = \
            version.VersionInfo('dovetail').version_string()
        report_obj['build_tag'] = dt_cfg.dovetail_config['build_tag']
        report_obj['upload_date'] =\
            datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
        report_obj['duration'] = duration

        report_obj['testcases_list'] = []
        if not testcase_list:
            return report_obj

        for testcase_name in testcase_list:
            testcase = Testcase.get(testcase_name)
            testcase_inreport = {}
            testcase_inreport['name'] = testcase_name
            if testcase is None:
                testcase_inreport['result'] = 'Undefined'
                testcase_inreport['objective'] = ''
                testcase_inreport['sub_testcase'] = []
                report_obj['testcases_list'].append(testcase_inreport)
                continue

            testcase_inreport['result'] = testcase.passed()
            testcase_inreport['objective'] = testcase.objective()
            testcase_inreport['sub_testcase'] = []
            if testcase.sub_testcase() is not None:
                for sub_test in testcase.sub_testcase():
                    testcase_inreport['sub_testcase'].append({
                        'name':
                        sub_test,
                        'result':
                        testcase.sub_testcase_passed(sub_test)
                    })
            report_obj['testcases_list'].append(testcase_inreport)
        cls.logger.debug(json.dumps(report_obj))
        return report_obj
Esempio n. 15
0
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pbr import version as pbr_version

MONITORS_VENDOR = "OpenStack Foundation"
MONITORS_PRODUCT = "OpenStack Masakari Monitors"
MONITORS_PACKAGE = None  # OS distro package version suffix

loaded = False
version_info = pbr_version.VersionInfo('masakari-monitors')
version_string = version_info.version_string


def _load_config():
    # Don't load in global context, since we can't assume
    # these modules are accessible when distutils uses
    # this module
    from six.moves import configparser

    from oslo_config import cfg

    from oslo_log import log as logging

    global loaded, MONITORS_VENDOR, MONITORS_PRODUCT, MONITORS_PACKAGE
    if loaded:
Esempio n. 16
0
from pbr import version as pbr_version

loaded = False
version_info = pbr_version.VersionInfo('nezha')
version_string = version_info.version_string
Esempio n. 17
0
               help='Run id to use for the specified subunit stream, can only'
                    ' be used if a single stream is provided'),
    cfg.StrOpt('attr_regex', default='\[(.*)\]',
               help='The regex to use to extract the comma separated list of '
                    'test attributes from the test_id'),
    cfg.StrOpt('test_attr_prefix', short='p', default=None,
               help='An optional prefix to identify global test attrs '
                    'and treat it as test metadata instead of test_run '
                    'metadata'),
    cfg.StrOpt('run_at', default=None,
               help="The optional datetime string for the run was started, "
                    "If one isn't provided the date and time of when "
                    "subunit2sql is called will be used")
]

_version_ = version.VersionInfo('subunit2sql').version_string()


def cli_opts():
    for opt in SHELL_OPTS:
        CONF.register_cli_opt(opt)


def list_opts():
    """Return a list of oslo.config options available.

    The purpose of this is to allow tools like the Oslo sample config file
    generator to discover the options exposed to users.
    """
    return [('DEFAULT', copy.deepcopy(SHELL_OPTS))]
Esempio n. 18
0
# Copyright 2014
# The Cloudscaling Group, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pbr import version

version_info = version.VersionInfo('python-watcherclient')
__version__ = version_info.version_string()
Esempio n. 19
0
#    Copyright 2011 OpenStack Foundation
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from pbr import version as pbr_version

SGSERVICE_VENDOR = "Huawei"
SGSERVICE_PRODUCT = "Huawei SGService"
SGSERVICE_PACKAGE = None  # OS distro package version suffix

loaded = False
version_info = pbr_version.VersionInfo('sgservice')
version_string = version_info.version_string
Esempio n. 20
0
# Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from pbr import version as pbr_version

RALLY_VENDOR = "OpenStack Foundation"
RALLY_PRODUCT = "OpenStack Rally"
RALLY_PACKAGE = None  # OS distro package version suffix

loaded = False
version_info = pbr_version.VersionInfo("rally")


def version_string():
    return version_info.semantic_version().debian_string()
Esempio n. 21
0
"""Define the top-level cli command."""
import os

import click
from pbr import version
import pkg_resources

from bids2datapackage.cli.base import AbstractCommand
from bids2datapackage import config

# Retrieve the project version from packaging.
try:
    try:
        version_info = version.VersionInfo('bids2datapackage')
        __version__ = version_info.release_string()
    except pkg_resources.DistributionNotFound:
        distribution_info = pkg_resources.get_distribution('pip')
        __version__ = distribution_info.version
except Exception:
    __version__ = None

APP_NAME = 'bids2datapackage'


# pylint: disable=unused-argument
#   The arguments are used via the `self.args` dict of the `AbstractCommand` class.
@click.group()
@click.version_option(version=__version__)
@click.option('--log-level',
              '-l',
              default='NOTSET',
Esempio n. 22
0
 def run(self):
     log.info("[pbr] Extracting deb version")
     name = self.distribution.get_name()
     print(version.VersionInfo(name).semantic_version().debian_string())
Esempio n. 23
0
        :param username: A string containing the username to use.
        :param password: A string containing the password to use.
        :param host: A string containing host to connect.
        :param fromurl: A boolean to determine if the WSDL should
                        be fetched from the `host`.
        :returns: BigIP
        """
        return pc.BIGIP(username=username,
                        password=password,
                        hostname=host,
                        fromurl=fromurl,
                        wsdls=self.WSDL_LIST)


if __name__ == '__main__':
    version = 'Load Balancer {0}'.format(version.VersionInfo('bigpyp'))
    args = docopt(__doc__, version=version)

    f = '../conf/{0}_vips.yml'.format(args['<name>'])
    with open(f, 'r') as file:
        vips_dict = yaml.load(file)
        b = BigIP(host='192.168.112.62', password=os.environ['PASS'])

        cert.Cert(b, vips_dict).create()
        profile.Profile(b, vips_dict).create()
        system.System(b).create()
        rule.Rule(b).create()
        monitor.Monitor(b).create()
        pool.Pool(b, vips_dict).create()
        virtual_server.VirtualServer(b, vips_dict).create()
# vim: tabstop=4 shiftwidth=4 softtabstop=4

#    Copyright 2011 OpenStack Foundation
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from pbr import version as pbr_version

CINDER_VENDOR = "OpenStack Foundation"
CINDER_PRODUCT = "OpenStack Cinder"
CINDER_PACKAGE = None  # OS distro package version suffix

loaded = False
version_info = pbr_version.VersionInfo('cinder')
version_string = version_info.version_string
Esempio n. 25
0
#    Copyright 2011 OpenStack Foundation
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from pbr import version as pbr_version

SDS_VENDOR = "OpenStack Foundation"
SDS_PRODUCT = "OpenStack Sds"
SDS_PACKAGE = None  # OS distro package version suffix

loaded = False
version_info = pbr_version.VersionInfo('sds')
version_string = version_info.version_string
Esempio n. 26
0
               help='project name of the coverage files'),
    cfg.StrOpt('coverage_file',
               positional=True,
               help='A coverage file to put into the database'),
    cfg.StrOpt('test-type',
               default='py27',
               help='test_type like a task name of tox e.g. py27'),
]

DATABASE_OPTS = [
    cfg.StrOpt('connection', default=None),
    cfg.IntOpt('max_pool_size', default=20),
    cfg.IntOpt('idle_timeout', default=3600),
]

_version_ = version.VersionInfo('coverage2sql').version_string()


def cli_opts():
    CONF.register_cli_opts(SHELL_OPTS)
    CONF.register_cli_opts(DATABASE_OPTS, 'database')


def list_opts():
    """Return a list of oslo.config options available.

    The purpose of this is to allow tools like the Oslo sample config file
    generator to discover the options exposed to users.
    """
    return [('DEFAULT', copy.deepcopy(SHELL_OPTS))]
Esempio n. 27
0
# Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pbr import version

version_info = version.VersionInfo('driverlog')
Esempio n. 28
0
# Holds the default variables
from pbr import version as pbr_version
import platform
import os

_v = pbr_version.VersionInfo("infrared").semantic_version()
__version__ = _v.release_string()
version_info = _v.version_tuple()


def version_details():
    from infrared import __version__  # noqa
    from ansible import __version__ as ansible_version  # noqa
    python_version = platform.python_version()
    python_revision = ', '.join(platform.python_build())
    return "{__version__} (" \
        "ansible-{ansible_version}, " \
        "python-{python_version})".format(**locals())

__all__ = (
    '__version__',   # string, standard across most modules
    'version_info',  # version tuple, same format as python sys.version_info
    'version_details'  # detailed version information, which may include major deps or plugins, used for bug reporting
)

SHARED_GROUPS = [
    {
        'title': 'Debug Options',
        'options': {
            'debug': {
                'action': 'store_true',
Esempio n. 29
0
# Copyright (c) 2017 Intel, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pbr import version

version_info = version.VersionInfo('valence')
Esempio n. 30
0
# -*- coding: utf-8 -*-

#  Licensed under the Apache License, Version 2.0 (the "License"); you may
#  not use this file except in compliance with the License. You may obtain
#  a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#  License for the specific language governing permissions and limitations
#  under the License.

from pbr import version

version_info = version.VersionInfo('bork_api')
version_string = version_info.cached_version_string()