2016-04-19 15:57:08 +02:00
|
|
|
"""mock libvirt module
|
|
|
|
|
|
|
|
WARNING: you did not import real libvirt module
|
|
|
|
|
|
|
|
This is needed, because we don't currently ship libvirt-python for templates.
|
|
|
|
The module contains libvirtError and openReadOnly() function, which
|
|
|
|
does nothing and raises the aforementioned exception. More functions can be
|
|
|
|
added as needed.
|
|
|
|
"""
|
|
|
|
|
|
|
|
class libvirtError(Exception):
|
|
|
|
pass
|
|
|
|
|
2017-09-21 14:18:02 +02:00
|
|
|
class virConnect:
|
|
|
|
pass
|
|
|
|
|
|
|
|
class virDomain:
|
|
|
|
pass
|
|
|
|
|
2016-04-19 15:57:08 +02:00
|
|
|
def openReadOnly(*args, **kwargs):
|
|
|
|
raise libvirtError('mock module, always raises')
|
2017-03-15 18:38:39 +01:00
|
|
|
|
2017-09-01 18:38:32 +02:00
|
|
|
def registerErrorHandler(f, ctx):
|
|
|
|
pass
|
|
|
|
|
2017-03-15 18:38:39 +01:00
|
|
|
VIR_DOMAIN_BLOCKED = 2
|
|
|
|
VIR_DOMAIN_RUNNING = 1
|
|
|
|
VIR_DOMAIN_PAUSED = 3
|
|
|
|
VIR_DOMAIN_SHUTDOWN = 4
|
|
|
|
VIR_DOMAIN_SHUTOFF = 5
|
|
|
|
VIR_DOMAIN_CRASHED = 6
|
|
|
|
VIR_DOMAIN_PMSUSPENDED = 7
|