libvirt.py 612 B

1234567891011121314151617181920212223
  1. """mock libvirt module
  2. WARNING: you did not import real libvirt module
  3. This is needed, because we don't currently ship libvirt-python for templates.
  4. The module contains libvirtError and openReadOnly() function, which
  5. does nothing and raises the aforementioned exception. More functions can be
  6. added as needed.
  7. """
  8. class libvirtError(Exception):
  9. pass
  10. def openReadOnly(*args, **kwargs):
  11. raise libvirtError('mock module, always raises')
  12. VIR_DOMAIN_BLOCKED = 2
  13. VIR_DOMAIN_RUNNING = 1
  14. VIR_DOMAIN_PAUSED = 3
  15. VIR_DOMAIN_SHUTDOWN = 4
  16. VIR_DOMAIN_SHUTOFF = 5
  17. VIR_DOMAIN_CRASHED = 6
  18. VIR_DOMAIN_PMSUSPENDED = 7