Exemplo n.º 1
0
    def run(
        self, packs, abs_repo_base, verifyssl=True, force=False, dependency_list=None
    ):
        result = {}
        pack_url = None

        if dependency_list:
            for pack_dependency in dependency_list:
                pack_result = download_pack(
                    pack=pack_dependency,
                    abs_repo_base=abs_repo_base,
                    verify_ssl=verifyssl,
                    force=force,
                    proxy_config=self.proxy_config,
                    force_permissions=True,
                    logger=self.logger,
                )
                pack_url, pack_ref, pack_result = pack_result
                result[pack_ref] = pack_result
        else:
            for pack in packs:
                pack_result = download_pack(
                    pack=pack,
                    abs_repo_base=abs_repo_base,
                    verify_ssl=verifyssl,
                    force=force,
                    proxy_config=self.proxy_config,
                    force_permissions=True,
                    logger=self.logger,
                )
                pack_url, pack_ref, pack_result = pack_result
                result[pack_ref] = pack_result

        return self._validate_result(result=result, repo_url=pack_url)
Exemplo n.º 2
0
def main(argv):
    _register_cli_opts()

    # Parse CLI args, set up logging
    common_setup(config=config, setup_db=False, register_mq_exchanges=False,
                 register_internal_trigger_types=False)

    packs = cfg.CONF.pack
    verify_ssl = cfg.CONF.verify_ssl
    force = cfg.CONF.force

    proxy_config = get_and_set_proxy_config()

    for pack in packs:
        LOG.info('Installing pack "%s"' % (pack))
        result = download_pack(pack=pack, verify_ssl=verify_ssl, force=force,
                               proxy_config=proxy_config, force_permissions=True)

        # Raw pack name excluding the version
        pack_name = result[1]
        success = result[2][0]

        if success:
            LOG.info('Successfully installed pack "%s"' % (pack_name))
        else:
            error = result[2][1]
            LOG.error('Failed to installed pack "%s": %s' % (pack_name, error))
            sys.exit(2)

    return 0
Exemplo n.º 3
0
def main(argv):
    _register_cli_opts()

    # Parse CLI args, set up logging
    common_setup(config=config, setup_db=False, register_mq_exchanges=False,
                 register_internal_trigger_types=False)

    packs = cfg.CONF.pack
    verify_ssl = cfg.CONF.verify_ssl
    force = cfg.CONF.force
    use_python3 = cfg.CONF.use_python3

    proxy_config = get_and_set_proxy_config()

    for pack in packs:
        LOG.info('Installing pack "%s"' % (pack))
        result = download_pack(pack=pack, verify_ssl=verify_ssl, force=force,
                               proxy_config=proxy_config, force_permissions=True,
                               use_python3=use_python3)

        # Raw pack name excluding the version
        pack_name = result[1]
        success = result[2][0]

        if success:
            LOG.info('Successfully installed pack "%s"' % (pack_name))
        else:
            error = result[2][1]
            LOG.error('Failed to installed pack "%s": %s' % (pack_name, error))
            sys.exit(2)

    return 0
Exemplo n.º 4
0
    def run(self, packs, abs_repo_base, verifyssl=True, force=False):
        result = {}

        for pack in packs:
            pack_result = download_pack(pack=pack, abs_repo_base=abs_repo_base,
                                        verify_ssl=verifyssl, force=force,
                                        proxy_config=self.proxy_config,
                                        force_permissions=True,
                                        logger=self.logger)
            pack_url, pack_ref, pack_result = pack_result
            result[pack_ref] = pack_result

        return self._validate_result(result=result, repo_url=pack_url)
Exemplo n.º 5
0
def main(argv):
    _register_cli_opts()

    # Parse CLI args, set up logging
    common_setup(config=config,
                 setup_db=False,
                 register_mq_exchanges=False,
                 register_internal_trigger_types=False)

    packs = cfg.CONF.pack
    verify_ssl = cfg.CONF.verify_ssl
    force = cfg.CONF.force
    use_python3 = cfg.CONF.use_python3

    proxy_config = get_and_set_proxy_config()

    for pack in packs:
        # 1. Download the pack
        LOG.info('Installing pack "%s"' % (pack))
        result = download_pack(pack=pack,
                               verify_ssl=verify_ssl,
                               force=force,
                               proxy_config=proxy_config,
                               force_permissions=True,
                               use_python3=use_python3)

        # Raw pack name excluding the version
        pack_name = result[1]
        success = result[2][0]

        if success:
            LOG.info('Successfully installed pack "%s"' % (pack_name))
        else:
            error = result[2][1]
            LOG.error('Failed to install pack "%s": %s' % (pack_name, error))
            sys.exit(2)

        # 2. Setup pack virtual environment
        LOG.info('Setting up virtualenv for pack "%s"' % (pack_name))
        setup_pack_virtualenv(pack_name=pack_name,
                              update=False,
                              logger=LOG,
                              proxy_config=proxy_config,
                              use_python3=use_python3,
                              no_download=True)
        LOG.info('Successfully set up virtualenv for pack "%s"' % (pack_name))

    return 0