1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-13 12:59:30 +03:00
Commit Graph

9 Commits

Author SHA1 Message Date
74a78fa42c examples: Fix white space
indent by 4 spaces
one spaces around assignments

Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-08-05 07:43:02 +00:00
b801ff31fa examples: Replace sys.exit() with exit()
No need to import sys.

Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-08-05 07:43:02 +00:00
06aba185a8 examples: Convert to ArgumentParser
Replace getopt() and hand-rolled-parser with argparse.ArgumentParser.

Fix wrong header comments copy-pasted from domstart.py

Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-08-05 07:43:02 +00:00
9cf539a2a8 examples: Add/fix PEP 484 type annotation
Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-08-05 07:43:02 +00:00
a19f086831 examples/dhcp*: Fix None comparison
None should be compared with "is None" instead of "== None", as the
later would invoke a "__cmp__()" method.

Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-08-05 07:43:01 +00:00
ed545f9fff examples: Refactor domipaddrs
This patch makes domipaddrs example compatible with Python3.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2020-07-15 11:05:35 +01:00
4d99e8443c examples: Fix connection error handling 2
Fix two more cases in examples as
libvirt.open*() does not return None but raises an exception

Fixes: 283e2bc693
Signed-off-by: Philipp Hahn <hahn@univention.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-04-27 11:16:21 +02:00
b22e4f2441 Drop support for python 2
python2 will be end of life by the time of the next
libvirt release. All our supported build targets, including
CentOS7, have a python3 build available.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-12-04 12:14:51 +00:00
0be1f5e31a Expose virDomainInterfacesAddresses to python binding
examples/Makefile.am:
  * Add new file domipaddrs.py

examples/README:
  * Add documentation for the python example

libvirt-override-api.xml:
  * Add new symbol for virDomainInterfacesAddresses

libvirt-override.c:
  * Hand written python api

Example:
  $ python examples/domipaddrs.py qemu:///system f18
    Interface  MAC address          Protocol     Address
    vnet0      52:54:00:20:70:3d    ipv4         192.168.105.240/16

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-03-28 11:21:56 +01:00