summaryrefslogtreecommitdiff
path: root/examples/domipaddrs.py
Commit message (Collapse)AuthorAgeFilesLines
* examples: Fix white spacePhilipp Hahn2020-08-051-1/+1
| | | | | | | indent by 4 spaces one spaces around assignments Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples: Replace sys.exit() with exit()Philipp Hahn2020-08-051-3/+2
| | | | | | No need to import sys. Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples: Convert to ArgumentParserPhilipp Hahn2020-08-051-17/+11
| | | | | | | | 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>
* examples: Add/fix PEP 484 type annotationPhilipp Hahn2020-08-051-1/+1
| | | | Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples/dhcp*: Fix None comparisonPhilipp Hahn2020-08-051-1/+1
| | | | | | | 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>
* examples: Refactor domipaddrsRadostin Stoyanov2020-07-151-51/+55
| | | | | | This patch makes domipaddrs example compatible with Python3. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
* examples: Fix connection error handling 2Philipp Hahn2020-04-271-2/+3
| | | | | | | | | Fix two more cases in examples as libvirt.open*() does not return None but raises an exception Fixes: 283e2bc693746164b22226e14d6fe3ccd38a07bf Signed-off-by: Philipp Hahn <hahn@univention.de> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* Drop support for python 2Daniel P. Berrangé2019-12-041-1/+1
| | | | | | | | | 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>
* Expose virDomainInterfacesAddresses to python bindingv1.2.14Pavel Hrdina2015-03-281-0/+57
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>