mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-05 04:25:19 +00:00
Use python discovered through env instead of hardcoding a path
This is more flexible regarding the location of the python binary but doesn't allow to pass the -u flag. The -i flag can be passed from inside the script using the PYTHONINSPECT env variable. This fixes a problem with the esx_vi_generator.py on FreeBSD.
This commit is contained in:
parent
f76c6dde2e
commit
e4384459c9
@ -1,4 +1,4 @@
|
|||||||
#! /usr/bin/python
|
#!/usr/bin/env python
|
||||||
# dominfo - print some information about a domain
|
# dominfo - print some information about a domain
|
||||||
|
|
||||||
import libvirt
|
import libvirt
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#! /usr/bin/python
|
#!/usr/bin/env python
|
||||||
# domstart - make sure a given domU is running, if not start it
|
# domstart - make sure a given domU is running, if not start it
|
||||||
|
|
||||||
import libvirt
|
import libvirt
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#! /usr/bin/python
|
#!/usr/bin/env python
|
||||||
# domstart - make sure a given domU is running, if not start it
|
# domstart - make sure a given domU is running, if not start it
|
||||||
|
|
||||||
import libvirt
|
import libvirt
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#! /usr/bin/python
|
#!/usr/bin/env python
|
||||||
# domstart - make sure a given domU is running, if not start it
|
# domstart - make sure a given domU is running, if not start it
|
||||||
|
|
||||||
import libvirt
|
import libvirt
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#! /usr/bin/python
|
#!/usr/bin/env python
|
||||||
# esxlist - list active domains of an ESX host and print some info.
|
# esxlist - list active domains of an ESX host and print some info.
|
||||||
# also demonstrates how to use the libvirt.openAuth() method
|
# also demonstrates how to use the libvirt.openAuth() method
|
||||||
|
|
||||||
|
@ -1010,7 +1010,7 @@ def buildWrappers():
|
|||||||
classes = open("libvirt.py", "w")
|
classes = open("libvirt.py", "w")
|
||||||
|
|
||||||
extra = open(os.path.join(srcPref,"libvirt-override.py"), "r")
|
extra = open(os.path.join(srcPref,"libvirt-override.py"), "r")
|
||||||
classes.write("#!/usr/bin/python -i\n")
|
classes.write("#!/usr/bin/env python\n")
|
||||||
classes.write("#\n")
|
classes.write("#\n")
|
||||||
classes.write("# WARNING WARNING WARNING WARNING\n")
|
classes.write("# WARNING WARNING WARNING WARNING\n")
|
||||||
classes.write("#\n")
|
classes.write("#\n")
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
# Manually written part of python bindings for libvirt
|
# Manually written part of python bindings for libvirt
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# Specify -i commandline option after python was started
|
||||||
|
if __name__ == "__main__":
|
||||||
|
import os
|
||||||
|
os.environ["PYTHONINSPECT"] = "1"
|
||||||
|
|
||||||
# On cygwin, the DLL is called cygvirtmod.dll
|
# On cygwin, the DLL is called cygvirtmod.dll
|
||||||
try:
|
try:
|
||||||
import libvirtmod
|
import libvirtmod
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
#
|
#
|
||||||
# esx_vi_generator.py: generates most of the SOAP type mapping code
|
# esx_vi_generator.py: generates most of the SOAP type mapping code
|
||||||
|
Loading…
Reference in New Issue
Block a user