# Path: moduleframework/core.py
# DATADIR = ['usr', 'share', 'moduleframework']
# def is_debug():
# def is_not_silent():
# def print_info(*args):
# def print_debug(*args):
# 
# Path: moduleframework/common.py
# class MTFConfParser(dict):
# class CommonFunctions(object):
#     def __init__(self):
# def generate_unique_name(size=10):
# def get_openshift_local():
# def get_openshift_ip():
# def get_openshift_user():
# def get_openshift_passwd():
# def get_if_install_default_profile():
# def is_recursive_download():
# def get_if_do_cleanup():
# def get_if_reuse():
# def get_if_remoterepos():
# def get_odcs_envvar():
# def is_true(value):
# def get_openidc_auth():
# def get_if_module():
# def sanitize_text(text, replacement="_", invalid_chars=["/", ";", "&", ">", "<", "|"]):
# def sanitize_cmd(cmd):
# def translate_cmd(cmd, translation_dict=None):
# def get_profile():
# def get_url():
# def get_compose_url():
# def get_modulemdurl():
#     def __init__(self, *args, **kwargs):
#     def loadconfig(self):
#     def set_url(self, url=None, force=False):
#     def get_url(self):
#     def get_template(self):
#     def get_docker_pull(self):
#     def getArch(self):
#     def runHost(self, command="ls /", **kwargs):
#     def get_test_dependencies(self):
#     def installTestDependencies(self, packages=None):
#     def getPackageList(self, profile=None):
#     def getModuleDependencies(self):
#     def dependency_list(self):
#     def dependency_list(self, value):
#     def getModulemdYamlconfig(self, urllink=None):
#     def getIPaddr(self):
#     def ip_address(self):
#     def ip_address(self, value):
#     def _callSetupFromConfig(self):
#     def _callCleanupFromConfig(self):
#     def run(self, command, **kwargs):
#     def get_packager(self):
#     def status(self, command="/bin/true"):
#     def start(self, command="/bin/true"):
#     def stop(self, command="/bin/true"):
#     def install_packages(self, packages=None):
#     def tearDown(self):
#     def copyTo(self, src, dest):
#     def copyFrom(self, src, dest):
#     def run_script(self, filename, *args, **kwargs):
# def get_config(fail_without_url=True, reload=False):
# def list_modules_from_config():
# def get_backend_list():
# def get_module_type():
# def get_module_type_base():
# def get_docker_file(dir_name=conf["docker"]["dockerfiledefaultlocation"]):
# def get_helpmd_file(dir_name=conf["docker"]["dockerfiledefaultlocation"]):
# def getBasePackageSet(modulesDict=None, isModule=True, isContainer=False):
# def get_base_compose():
# 
# Path: moduleframework/mtfexceptions.py
# class ModuleFrameworkException(Exception):
# class NspawnExc(ModuleFrameworkException):
# class RpmExc(ModuleFrameworkException):
# class ContainerExc(ModuleFrameworkException):
# class ConfigExc(ModuleFrameworkException):
# class DefaultConfigExc(ModuleFrameworkException):
# class PDCExc(ModuleFrameworkException):
# class KojiExc(ModuleFrameworkException):
# class CmdExc(ModuleFrameworkException):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):


import os
import logging
import shutil
import glob
import time
import re
from avocado import Test
from avocado.utils import process
from moduleframework import core, common, mtfexceptions
        """
        Internal method for installing packages to chroot and set repositories.
        
        :return: None
        """
        self.logger.debug("Install system to direcory: %s" % self.location)
        if not os.path.exists(os.path.join(self.location, "usr")):
            if not os.path.exists(self.location):
                os.makedirs(self.location)
            repos_to_use = ""
            counter = 0
            for repo in self.repos:
                counter = counter + 1
                repos_to_use += " --repofrompath %s%d,%s" % (
                    self.name, counter, repo)
            self.logger.debug("Install packages: %s" % self.packageset)
            self.logger.debug("Repositories: %s" % self.repos)
            process.run("%s install --nogpgcheck --setopt=install_weak_deps=False "
                 "--installroot %s --allowerasing --disablerepo=* --enablerepo=%s* %s %s" %
                                    (self.packager, self.location, self.name,
                                     repos_to_use, " ".join(self.packageset)),
                        verbose=is_debug_low())
            insiderepopath = os.path.join(self.location, self.yumrepo[1:])
            if not os.path.exists(os.path.dirname(insiderepopath)):
                os.makedirs(os.path.dirname(insiderepopath))
            counter = 0
            with open(insiderepopath, 'w') as f:
                for repo in self.repos:
                    counter = counter + 1
                    add = """

# Path: moduleframework/core.py
# DATADIR = ['usr', 'share', 'moduleframework']
# def is_debug():
# def is_not_silent():
# def print_info(*args):
# def print_debug(*args):
# 
# Path: moduleframework/common.py
# class MTFConfParser(dict):
# class CommonFunctions(object):
#     def __init__(self):
# def generate_unique_name(size=10):
# def get_openshift_local():
# def get_openshift_ip():
# def get_openshift_user():
# def get_openshift_passwd():
# def get_if_install_default_profile():
# def is_recursive_download():
# def get_if_do_cleanup():
# def get_if_reuse():
# def get_if_remoterepos():
# def get_odcs_envvar():
# def is_true(value):
# def get_openidc_auth():
# def get_if_module():
# def sanitize_text(text, replacement="_", invalid_chars=["/", ";", "&", ">", "<", "|"]):
# def sanitize_cmd(cmd):
# def translate_cmd(cmd, translation_dict=None):
# def get_profile():
# def get_url():
# def get_compose_url():
# def get_modulemdurl():
#     def __init__(self, *args, **kwargs):
#     def loadconfig(self):
#     def set_url(self, url=None, force=False):
#     def get_url(self):
#     def get_template(self):
#     def get_docker_pull(self):
#     def getArch(self):
#     def runHost(self, command="ls /", **kwargs):
#     def get_test_dependencies(self):
#     def installTestDependencies(self, packages=None):
#     def getPackageList(self, profile=None):
#     def getModuleDependencies(self):
#     def dependency_list(self):
#     def dependency_list(self, value):
#     def getModulemdYamlconfig(self, urllink=None):
#     def getIPaddr(self):
#     def ip_address(self):
#     def ip_address(self, value):
#     def _callSetupFromConfig(self):
#     def _callCleanupFromConfig(self):
#     def run(self, command, **kwargs):
#     def get_packager(self):
#     def status(self, command="/bin/true"):
#     def start(self, command="/bin/true"):
#     def stop(self, command="/bin/true"):
#     def install_packages(self, packages=None):
#     def tearDown(self):
#     def copyTo(self, src, dest):
#     def copyFrom(self, src, dest):
#     def run_script(self, filename, *args, **kwargs):
# def get_config(fail_without_url=True, reload=False):
# def list_modules_from_config():
# def get_backend_list():
# def get_module_type():
# def get_module_type_base():
# def get_docker_file(dir_name=conf["docker"]["dockerfiledefaultlocation"]):
# def get_helpmd_file(dir_name=conf["docker"]["dockerfiledefaultlocation"]):
# def getBasePackageSet(modulesDict=None, isModule=True, isContainer=False):
# def get_base_compose():
# 
# Path: moduleframework/mtfexceptions.py
# class ModuleFrameworkException(Exception):
# class NspawnExc(ModuleFrameworkException):
# class RpmExc(ModuleFrameworkException):
# class ContainerExc(ModuleFrameworkException):
# class ConfigExc(ModuleFrameworkException):
# class DefaultConfigExc(ModuleFrameworkException):
# class PDCExc(ModuleFrameworkException):
# class KojiExc(ModuleFrameworkException):
# class CmdExc(ModuleFrameworkException):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):


# Path: mtf/backend/nspawn.py
import os
import logging
import shutil
import glob
import time
import re
from avocado import Test
from avocado.utils import process
from moduleframework import core, common, mtfexceptions

        """
        Internal method for installing packages to chroot and set repositories.
        
        :return: None
        """
        self.logger.debug("Install system to direcory: %s" % self.location)
        if not os.path.exists(os.path.join(self.location, "usr")):
            if not os.path.exists(self.location):
                os.makedirs(self.location)
            repos_to_use = ""
            counter = 0
            for repo in self.repos:
                counter = counter + 1
                repos_to_use += " --repofrompath %s%d,%s" % (
                    self.name, counter, repo)
            self.logger.debug("Install packages: %s" % self.packageset)
            self.logger.debug("Repositories: %s" % self.repos)
            process.run("%s install --nogpgcheck --setopt=install_weak_deps=False "
                 "--installroot %s --allowerasing --disablerepo=* --enablerepo=%s* %s %s" %
                                    (self.packager, self.location, self.name,
                                     repos_to_use, " ".join(self.packageset)),
                        verbose=is_debug_low())
            insiderepopath = os.path.join(self.location, self.yumrepo[1:])
            if not os.path.exists(os.path.dirname(insiderepopath)):
                os.makedirs(os.path.dirname(insiderepopath))
            counter = 0
            with open(insiderepopath, 'w') as f:
                for repo in self.repos:
                    counter = counter + 1
                    add = """

[%s%d]