robottelo.config.base

Define and instantiate the configuration class for Robottelo.

Module Contents

Classes

INIReader

ConfigParser wrapper able to cast value when reading INI options.

FeatureSettings

Settings related to a feature.

ServerSettings

Satellite server settings definitions.

BrokerSettings

Broker settings definitions.

BugzillaSettings

Bugzilla server settings definitions.

CapsuleSettings

Clients settings definitions.

CertsSettings

Katello-certs settings definitions.

ClientsSettings

Clients settings definitions.

ContainerRepositorySettings

Settings for syncing containers from container registries

DistroSettings

Distro settings definitions.

DockerSettings

Docker settings definitions.

AzureRMSettings

Azure Resource Manager settings definitions.

EC2Settings

AWS EC2 settings definitions.

FakeManifestSettings

Fake manifest settings defintitions.

GCESettings

Google Compute Engine settings definitions.

RHSSOSettings

RHSSO settings definitions.

LDAPSettings

LDAP settings definitions.

LDAPIPASettings

LDAP freeIPA settings definitions.

OpenLDAPSettings

Open LDAP settings definitions.

LibvirtHostSettings

Libvirt host settings definitions.

FakeCapsuleSettings

Fake Capsule settings definitions.

RHEVSettings

RHEV settings definitions.

VmWareSettings

VmWare settings definitions.

DiscoveryISOSettings

Discovery ISO name settings definition.

OscapSettings

Oscap settings definitions.

OSPSettings

OSP settings definitions.

PerformanceSettings

Performance settings definitions.

SSHClientSettings

SSHClient settings definitions.

VlanNetworkSettings

Vlan Network settings definitions.

UpgradeSettings

Satellite upgrade settings definitions.

SharedFunctionSettings

Shared function settings definitions.

VirtWhoSettings

VirtWho settings definitions.

ReportPortalSettings

Report portal settings definitions.

Settings

Robottelo’s settings representation.

HttpProxySettings

Http Proxy settings definitions.

Functions

get_project_root()

Return the path to the Robottelo project root directory.

Attributes

LOGGER

SETTINGS_FILE_NAME

robottelo.config.base.LOGGER
robottelo.config.base.SETTINGS_FILE_NAME = robottelo.properties
exception robottelo.config.base.ImproperlyConfigured

Bases: Exception

Indicates that Robottelo somehow is improperly configured.

For example, if settings file can not be found or some required configuration is not defined.

robottelo.config.base.get_project_root()

Return the path to the Robottelo project root directory.

Returns

A directory path.

Return type

str

class robottelo.config.base.INIReader(path)

ConfigParser wrapper able to cast value when reading INI options.

cast_boolean
cast_dict
cast_list
cast_logging_level
cast_tuple
cast_webdriver_desired_capabilities
get(self, section, option, default=None, cast=None)

Read an option from a section of a INI file.

First try to lookup for the value as an environment variable having the following format: ROBOTTELO_{SECTION}_{OPTION}.

The default value will return if the look up option is not available. The value will be cast using a callable if specified otherwise a string will be returned.

Parameters
  • section – Section to look for.

  • option – Option to look for.

  • default – The value that should be used if the option is not defined.

  • cast – If provided the value will be cast using the cast provided.

has_section(self, section)

Check if section is available.

class robottelo.config.base.FeatureSettings

Settings related to a feature.

Create a instance of this class and assign attributes to map to the feature options.

abstract read(self, reader)

Subclasses must implement this method in order to populate itself with expected settings values.

Parameters

reader – An INIReader instance to read the settings.

abstract validate(self)

Subclasses must implement this method in order to validade the settings and raise ImproperlyConfigured if any issue is found.

class robottelo.config.base.ServerSettings(*args, **kwargs)

Bases: FeatureSettings

Satellite server settings definitions.

read(self, reader)

Read and validate Satellite server settings.

property version(self)
validate(self)

Subclasses must implement this method in order to validade the settings and raise ImproperlyConfigured if any issue is found.

get_credentials(self)

Return credentials for interacting with a Foreman deployment API.

Returns

A username-password pair.

Return type

tuple

get_hostname(self, key='hostname')
get_url(self)

Return the base URL of the Foreman deployment being tested.

The following values from the config file are used to build the URL:

  • [server] scheme (default: https)

  • [server] hostname (required)

  • [server] port (default: none)

Setting port to 80 does not imply that scheme is ‘https’. If port is 80 and scheme is unset, scheme will still default to ‘https’.

Returns

A URL.

Return type

str

get_pub_url(self)

Return the pub URL of the server being tested.

The following values from the config file are used to build the URL:

  • main.server.hostname (required)

Returns

The pub directory URL.

Return type

str

get_cert_rpm_url(self)

Return the Katello cert RPM URL of the server being tested.

The following values from the config file are used to build the URL:

  • main.server.hostname (required)

Returns

The Katello cert RPM URL.

Return type

str

class robottelo.config.base.BrokerSettings(*args, **kwargs)

Bases: FeatureSettings

Broker settings definitions.

read(self, reader)

Read and validate broker settings.

validate(self)

This section is lazily validated on .issue_handlers.bugzilla.

class robottelo.config.base.BugzillaSettings(*args, **kwargs)

Bases: FeatureSettings

Bugzilla server settings definitions.

read(self, reader)

Read and validate Bugzilla server settings.

validate(self)

This section is lazily validated on .issue_handlers.bugzilla.

class robottelo.config.base.CapsuleSettings(*args, **kwargs)

Bases: FeatureSettings

Clients settings definitions.

read(self, reader)

Read clients settings.

property hostname(self)
validate(self)

Validate capsule settings.

class robottelo.config.base.CertsSettings(*args, **kwargs)

Bases: FeatureSettings

Katello-certs settings definitions.

read(self, reader)

Read certs settings.

validate(self)

Validate certs settings.

class robottelo.config.base.ClientsSettings(*args, **kwargs)

Bases: FeatureSettings

Clients settings definitions.

read(self, reader)

Read clients settings.

validate(self)

Validate clients settings.

class robottelo.config.base.ContainerRepositorySettings(*args, **kwargs)

Bases: FeatureSettings

Settings for syncing containers from container registries

section = container_repo
repo_config_required = ['label', 'registry_url', 'registry_username', 'registry_password', 'repos_to_sync']
read(self, reader)

Read container repo settings and associated yaml file

validate(self)

Subclasses must implement this method in order to validade the settings and raise ImproperlyConfigured if any issue is found.

_validate_registry_configs(self, configs)
class robottelo.config.base.DistroSettings(*args, **kwargs)

Bases: FeatureSettings

Distro settings definitions.

read(self, reader)

Read distro settings.

validate(self)

Validate distro settings.

class robottelo.config.base.DockerSettings(*args, **kwargs)

Bases: FeatureSettings

Docker settings definitions.

read(self, reader)

Read docker settings.

validate(self)

Validate docker settings.

class robottelo.config.base.AzureRMSettings(*args, **kwargs)

Bases: FeatureSettings

Azure Resource Manager settings definitions.

read(self, reader)

Read AzureRM settings.

validate(self)

Validate AzureRM settings.

class robottelo.config.base.EC2Settings(*args, **kwargs)

Bases: FeatureSettings

AWS EC2 settings definitions.

read(self, reader)

Read AWS EC2 settings.

validate(self)

Validate AWS EC2 settings.

class robottelo.config.base.FakeManifestSettings(*args, **kwargs)

Bases: FeatureSettings

Fake manifest settings defintitions.

read(self, reader)

Read fake manifest settings.

validate(self)

Validate fake manifest settings.

class robottelo.config.base.GCESettings(*args, **kwargs)

Bases: FeatureSettings

Google Compute Engine settings definitions.

read(self, reader)

Read GCE settings.

validate(self)

Validate GCE settings.

class robottelo.config.base.RHSSOSettings(*args, **kwargs)

Bases: FeatureSettings

RHSSO settings definitions.

read(self, reader)

Read LDAP settings.

validate(self)

Validate RHSSO settings.

class robottelo.config.base.LDAPSettings(*args, **kwargs)

Bases: FeatureSettings

LDAP settings definitions.

read(self, reader)

Read LDAP settings.

validate(self)

Validate LDAP settings.

class robottelo.config.base.LDAPIPASettings(*args, **kwargs)

Bases: FeatureSettings

LDAP freeIPA settings definitions.

read(self, reader)

Read LDAP freeIPA settings.

validate(self)

Validate LDAP freeIPA settings.

class robottelo.config.base.OpenLDAPSettings(*args, **kwargs)

Bases: FeatureSettings

Open LDAP settings definitions.

read(self, reader)

Read Open LDAP settings.

validate(self)

Validate Open LDAP settings.

class robottelo.config.base.LibvirtHostSettings(*args, **kwargs)

Bases: FeatureSettings

Libvirt host settings definitions.

read(self, reader)

Read libvirt host settings.

validate(self)

Validate libvirt host settings.

class robottelo.config.base.FakeCapsuleSettings(*args, **kwargs)

Bases: FeatureSettings

Fake Capsule settings definitions.

read(self, reader)

Read fake capsule settings

validate(self)

Validate fake capsule settings.

class robottelo.config.base.RHEVSettings(*args, **kwargs)

Bases: FeatureSettings

RHEV settings definitions.

read(self, reader)

Read rhev settings.

validate(self)

Validate rhev settings.

class robottelo.config.base.VmWareSettings(*args, **kwargs)

Bases: FeatureSettings

VmWare settings definitions.

read(self, reader)

Read vmware settings.

validate(self)

Validate vmware settings.

class robottelo.config.base.DiscoveryISOSettings(*args, **kwargs)

Bases: FeatureSettings

Discovery ISO name settings definition.

read(self, reader)

Read discovery iso setting.

validate(self)

Validate discovery iso name setting.

class robottelo.config.base.OscapSettings(*args, **kwargs)

Bases: FeatureSettings

Oscap settings definitions.

read(self, reader)

Read Oscap settings.

validate(self)

Validate Oscap settings.

class robottelo.config.base.OSPSettings(*args, **kwargs)

Bases: FeatureSettings

OSP settings definitions.

read(self, reader)

Read osp settings.

validate(self)

Validate osp settings.

class robottelo.config.base.PerformanceSettings(*args, **kwargs)

Bases: FeatureSettings

Performance settings definitions.

read(self, reader)

Read performance settings.

validate(self)

Validate performance settings.

class robottelo.config.base.SSHClientSettings(*args, **kwargs)

Bases: FeatureSettings

SSHClient settings definitions.

property command_timeout(self)
property connection_timeout(self)
read(self, reader)

Read SSHClient settings.

validate(self)

Validate SSHClient settings.

class robottelo.config.base.VlanNetworkSettings(*args, **kwargs)

Bases: FeatureSettings

Vlan Network settings definitions.

read(self, reader)

Read Vlan Network settings.

validate(self)

Validate Vlan Network settings.

class robottelo.config.base.UpgradeSettings(*args, **kwargs)

Bases: FeatureSettings

Satellite upgrade settings definitions.

read(self, reader)

Read and validate Satellite server settings.

validate(self)

Subclasses must implement this method in order to validade the settings and raise ImproperlyConfigured if any issue is found.

class robottelo.config.base.SharedFunctionSettings(*args, **kwargs)

Bases: FeatureSettings

Shared function settings definitions.

MAX_SHARE_TIMEOUT = 86400
read(self, reader)

Read shared settings.

validate(self)

Validate the shared settings

class robottelo.config.base.VirtWhoSettings(*args, **kwargs)

Bases: FeatureSettings

VirtWho settings definitions.

read(self, reader)

Read virtwho settings.

validate(self)

Validate virtwho settings.

class robottelo.config.base.ReportPortalSettings(*args, **kwargs)

Bases: FeatureSettings

Report portal settings definitions.

read(self, reader)

Read Report portal settings.

validate(self)

Validate Report portal settings.

class robottelo.config.base.Settings

Robottelo’s settings representation.

configure(self, settings_path=None)

Read the settings file and parse the configuration.

Parameters

settings_path (str) – path to settings file to read. If None, looks in the project root for a file named ‘robottelo.properties’.

Raises

ImproperlyConfigured if any issue is found during the parsing or validation of the configuration.

_read_robottelo_settings(self)

Read Robottelo’s general settings.

_validate_robottelo_settings(self)

Validate Robottelo’s general settings.

property configured(self)

Returns True if the settings have already been configured.

property all_features(self)

List all expected feature settings sections.

class robottelo.config.base.HttpProxySettings(*args, **kwargs)

Bases: FeatureSettings

Http Proxy settings definitions.

read(self, reader)

Read Http Proxy settings.

validate(self)

Validate Http Proxy settings.