def get_env_vars():
    """
    Gather LEAPP_DEVEL environment variables and respective mappings to provide them as messages to be
    available after reboot.
    """
    env_vars = []
    leapp_vars = {k: v for (k, v) in os.environ.items() if k.startswith('LEAPP_') and k not in ENV_IGNORE}
    for k, v in leapp_vars.items():
        if k in ENV_MAPPING:
            env_vars.append(EnvVar(name=ENV_MAPPING.get(k), value=v))
            continue
        env_vars.append(EnvVar(name=k, value=v))

    return env_vars
Пример #2
0
def get_env_vars():
    """
    Gather LEAPP_DEVEL environment variables and provide them as messages to be
    available after reboot.
    """
    return [
        EnvVar(name=k, value=v) for (k, v) in os.environ.items()
        if k.startswith('LEAPP_') and k not in ENV_IGNORE
    ]
Пример #3
0
 def __init__(self, envars=None):
     if envars:
         envarsList = [
             EnvVar(name=key, value=value) for key, value in envars.items()
         ]
     else:
         envarsList = []
     self.configuration = namedtuple('configuration',
                                     ['leapp_env_vars'])(envarsList)
Пример #4
0
    def __init__(self,
                 arch=architecture.ARCH_X86_64,
                 envars=None,
                 kernel='3.10.0-957.43.1.el7.x86_64',
                 release_id='rhel',
                 src_ver='7.8',
                 dst_ver='8.1',
                 msgs=None):
        envarsList = [EnvVar(name=k, value=v)
                      for k, v in envars.items()] if envars else []
        version = namedtuple('Version', ['source', 'target'])(src_ver, dst_ver)
        release = namedtuple('OS_release',
                             ['release_id', 'version_id'])(release_id, src_ver)

        self._common_folder = '../../files'
        self.configuration = namedtuple('configuration', [
            'architecture', 'kernel', 'leapp_env_vars', 'os_release', 'version'
        ])(arch, kernel, envarsList, release, version)
        self._msgs = msgs
Пример #5
0
"""
This is not regular library.

The library is supposed to be used only for testing purposes. Import of the
library is expected only inside test files.
"""

from leapp.models import IPUConfig, EnvVar, OSRelease, Version

CONFIG = IPUConfig(
    leapp_env_vars=[EnvVar(name='LEAPP_DEVEL', value='0')],
    os_release=OSRelease(release_id='rhel',
                         name='Red Hat Enterprise Linux Server',
                         pretty_name='RHEL',
                         version='7.6 (Maipo)',
                         version_id='7.6'),
    version=Version(source='7.6', target='8.0'),
    architecture='x86_64',
    kernel='3.10.0-957.43.1.el7.x86_64',
)

CONFIG_ALL_SIGNED = IPUConfig(
    leapp_env_vars=[EnvVar(name='LEAPP_DEVEL_RPMS_ALL_SIGNED', value='1')],
    os_release=OSRelease(release_id='rhel',
                         name='Red Hat Enterprise Linux Server',
                         pretty_name='RHEL',
                         version='7.6 (Maipo)',
                         version_id='7.6'),
    version=Version(source='7.6', target='8.0'),
    architecture='x86_64',
    kernel='3.10.0-957.43.1.el7.x86_64',
Пример #6
0
"""
This is not regular library.

The library is supposed to be used only for testing purposes. Import of the
library is expected only inside test files.
"""

from leapp.models import IPUConfig, EnvVar, OSRelease, Version

CONFIG = IPUConfig(
    leapp_env_vars=[EnvVar(name='LEAPP_DEVEL', value='0')],
    os_release=OSRelease(
        release_id='rhel',
        name='Red Hat Enterprise Linux Server',
        pretty_name='RHEL',
        version='7.6 (Maipo)',
        version_id='7.6'
    ),
    version=Version(
        source='7.6',
        target='8.0'
    ),
    architecture='x86_64',
    kernel='3.10.0-957.43.1.el7.x86_64',
)

CONFIG_NO_NETWORK_RENAMING = IPUConfig(
    leapp_env_vars=[EnvVar(name='LEAPP_DEVEL', value='0'), EnvVar(name='LEAPP_NO_NETWORK_RENAMING', value='1')],
    os_release=OSRelease(
        release_id='rhel',
Пример #7
0
class CurrentActorMocked(object):
    env_vars = [EnvVar(name='LEAPP_DEVEL_SKIP_WIP', value='0'),
                EnvVar(name='LEAPP_DEVEL_SKIP_DIP', value='1'),
                EnvVar(name='LEAPP_DEVEL_SKIP_RIP', value='2')]
    configuration = namedtuple('configuration', ['leapp_env_vars'])(env_vars)