robottelo.host_info

Module that gather several informations about host

Module Contents

Classes

SatVersionDependentValues

Class which return values depending on Satellite host version

Functions

get_host_os_version()

Fetches host’s OS version through SSH

get_host_sat_version()

Fetches host’s Satellite version through SSH

_extract_sat_version(ssh_cmd)

Extracts Satellite version if possible or ‘Not Available’ otherwise

get_repo_files(repo_path, extension='rpm', hostname=None)

Returns a list of repo files (for example rpms) in specific repository

get_repomd_revision(repo_path, hostname=None)

Fetches a revision of repository.

get_sat_version()

Try to read sat_version from envvar SATELLITE_VERSION

Attributes

LOGGER

_SAT_6_2_VERSION_COMMAND

_SAT_6_1_VERSION_COMMAND

robottelo.host_info.LOGGER
robottelo.host_info.get_host_os_version()

Fetches host’s OS version through SSH :return: str with version

robottelo.host_info._SAT_6_2_VERSION_COMMAND = rpm -q satellite
robottelo.host_info._SAT_6_1_VERSION_COMMAND = grep "VERSION" /usr/share/foreman/lib/satellite/version.rb
robottelo.host_info.get_host_sat_version()

Fetches host’s Satellite version through SSH :return: Satellite version :rtype: version

robottelo.host_info._extract_sat_version(ssh_cmd)

Extracts Satellite version if possible or ‘Not Available’ otherwise

Parameters

ssh_cmd – str ssh command

Returns

Satellite version

Return type

str

robottelo.host_info.get_repo_files(repo_path, extension='rpm', hostname=None)

Returns a list of repo files (for example rpms) in specific repository directory.

Parameters
  • repo_path (str) – unix path to the repo, e.g. ‘/var/lib/pulp/fooRepo/’

  • extension (str) – extension of searched files. Defaults to ‘rpm’

  • optional hostname (str) – hostname or IP address of the remote host. If None the hostname will be get from main.server.hostname config.

Returns

list representing rpm package names

Return type

list

robottelo.host_info.get_repomd_revision(repo_path, hostname=None)

Fetches a revision of repository.

Parameters
  • repo_path (str) – unix path to the repo, e.g. ‘/var/lib/pulp/fooRepo’

  • optional hostname (str) – hostname or IP address of the remote host. If None the hostname will be get from main.server.hostname config.

Returns

string containing repository revision

Return type

str

class robottelo.host_info.SatVersionDependentValues(*dcts, **kwargs)

Class which return values depending on Satellite host version

__getitem__(self, item)

Return value dependent on Satellite version :param item: str :return: respective Satellite version values

robottelo.host_info.get_sat_version()

Try to read sat_version from envvar SATELLITE_VERSION if not available fallback to ssh connection to get it.