[libvirt] [PATCH] Use python discovered through env instead of hardcoding a path

Eric Blake eblake at redhat.com
Sat Nov 13 20:04:38 UTC 2010


On 11/13/2010 08:53 AM, Matthias Bolte wrote:
> 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.
> ---
>  examples/python/dominfo.py    |    2 +-
>  examples/python/domrestore.py |    2 +-
>  examples/python/domsave.py    |    2 +-
>  examples/python/domstart.py   |    2 +-
>  examples/python/esxlist.py    |    2 +-
>  python/generator.py           |    2 +-
>  python/libvirt-override.py    |    5 +++++
>  src/esx/esx_vi_generator.py   |    2 +-
>  8 files changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/examples/python/dominfo.py b/examples/python/dominfo.py
> index e41709c..2f250e7 100755
> --- a/examples/python/dominfo.py
> +++ b/examples/python/dominfo.py
> @@ -1,4 +1,4 @@
> -#! /usr/bin/python
> +#!/usr/bin/env python

ACK.  It still assumes a hard-coded location, but /usr/bin/env is more
likely to exist on all platforms, regardless of where python was
installed.  It's a shame that #! lines are so limited, and portably take
only one argument, which is now "python".

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101113/7e0c2a16/attachment-0001.sig>


More information about the libvir-list mailing list