ovirtlago package¶
Submodules¶
ovirtlago.cmd module¶
ovirtlago.constants module¶
ovirtlago.paths module¶
ovirtlago.prefix module¶
ovirtlago.reposetup module¶
-
ovirtlago.reposetup.
merge
(output_dir, sources, repoman_config=None)[source]¶ Run repoman on
sources
, creating a new RPM repository inoutput_dir
- Args:
output_dir(str): Path to create new repository sources(list of str): repoman sources repoman_config(str): repoman configuration file, if not passed it will
use default repoman configurations, equivalent to:
[main]on_empty_source=warn[store.RPMStore]on_wrong_distro=copy_to_allwith_srcrpms=falsewith_sources=false- Raises:
RepositoryMergeError
: If repoman command failed.IOError
: Ifrepoman_config
is passed but does not exists.- Returns:
- None
-
ovirtlago.reposetup.
with_repo_server
(func)[source]¶ A decorator that starts an http server which serves the prefix’s internal_repo. The server will listen on the management network’s IP, and on port constans.REPO_SERVER_PORT
- Args:
- The first argument to the wrapped func should be a
- lago.prefix.Prefix instance.
ovirtlago.server module¶
-
class
ovirtlago.server.
LagoThreadingTCPServer
(server_address, RequestHandlerClass, allowed_exceptions=(), allowed_errnos=(32, ))[source]¶ Bases:
SocketServer.ThreadingTCPServer
A custom multi-threaded TCP server.
We use allow_reuse_address in order to avoid a race when opening and closing multiple servers (at each point in time only one server is listening). For example, the first server has a connection in ‘time_wait’ state, while the second server tries to bind its socket.
- Attributes:
- _allowed_exceptions(tuple of Exceptions): If an exception occurs
- and its type isn’t not in _allowed_exceptions, its traceback will be printed to the log.
- _allowed_errnos(tuple of ints): If an OSError exception occurs
- and its errno isn’t not in _allowed_errnos, its traceback will be printed to the log.
-
allow_reuse_address
= True¶
ovirtlago.testlib module¶
-
class
ovirtlago.testlib.
LogCollectorPlugin
(prefix)[source]¶ Bases:
nose.plugins.base.Plugin
-
configure
(options, conf)[source]¶ Configure the plugin and system, based on selected options.
The base plugin class sets the plugin to enabled if the enable option for the plugin (self.enableOpt) is true.
-
name
= 'log-collector-plugin'¶
-
-
class
ovirtlago.testlib.
TaskLogNosePlugin
(*args, **kwargs)[source]¶ Bases:
nose.plugins.base.Plugin
-
configure
(options, conf)[source]¶ Configure the plugin and system, based on selected options.
The base plugin class sets the plugin to enabled if the enable option for the plugin (self.enableOpt) is true.
-
name
= 'tasklog-plugin'¶
-
options
(parser, env)[source]¶ Register commandline options.
Implement this method for normal options behavior with protection from OptionConflictErrors. If you override this method and want the default –with-$name option to be registered, be sure to call super().
-
score
= 10000¶
-
ovirtlago.utils module¶
ovirtlago.virt module¶
-
class
ovirtlago.virt.
EngineVM
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
-
class
ovirtlago.virt.
HEHostVM
(*args, **kwargs)[source]¶ Bases:
ovirtlago.virt.HostVM
-
class
ovirtlago.virt.
HostVM
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
-
class
ovirtlago.virt.
NodeVM
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
-
class
ovirtlago.virt.
OvirtVirtEnv
(prefix, vm_specs, net_spec)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
-
assert_engine_alive
(timeout=120)[source]¶ Assert service ‘ovirt-engine’ reports running on the engine VM
- Args:
- timeout(int): timeout
- Returns:
- None
- Raises:
- AssertionError: if ovirt-engine is not reported running after the
- given timeout, or ssh is unreachable.
-
assert_vdsm_alive
(timeout=120)[source]¶ Assert service ‘vdsmd’ reports running on all vdsm hosts
- Args:
- timeout(int): timeout
- Returns:
- None
- Raises:
- AssertionError: if vdsmd is not reported running after the
- given timeout, or ssh is unreachable.
-
get_ovirt_cpu_family
(host=None)[source]¶ Get a suitable string for oVirt Cluster CPU. If
host
is None, it will use a random host, if no hosts are available it will use the Engine VM for detection. The detection is done by getting the VM host CPU model and vendor, from Lago, which in its turn is based on what was configured in the LagoInitFile. The detected model and vendor are then compared against the definitions in data/ovirt-cpu-map.yaml or against a custom file, ifovirt-cpu-map
parameter was defined in the host’s metadata section.- Args:
- host(lago.vm.DefaultVM): VM CPU/vendor to use for detection
- Returns:
- str: oVirt CPU Cluster string
- Raises:
- RuntimeError: If unsupported cpu vendor or model is detected
-