diff mbox

[KVM-AUTOTEST,1/4] Make all programs on kvm test use /usr/bin/python

Message ID 1244565209-9132-1-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues June 9, 2009, 4:33 p.m. UTC
All kvm modules that can be used as stand alone programs were
updated to use #!/usr/bin/python instead of #!/usr/bin/env python,
complying with the rest of the autotest code base.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
---
 client/tests/kvm/fix_cdkeys.py   |    2 +-
 client/tests/kvm/kvm_config.py   |    1 +
 client/tests/kvm/scan_results.py |    2 +-
 client/tests/kvm/stepeditor.py   |    2 +-
 client/tests/kvm/stepmaker.py    |    2 +-
 5 files changed, 5 insertions(+), 4 deletions(-)

Comments

Martin Bligh June 9, 2009, 5 p.m. UTC | #1
I'd suggest you use the same mechanism as the other entry points,
and override the python version where necessary - some distros
have ancient or bleeding edge default Python versions.

see common.py -> setup_modules.py -> check_version.check_python_version

On Tue, Jun 9, 2009 at 9:33 AM, Lucas Meneghel Rodrigues<lmr@redhat.com> wrote:
> All kvm modules that can be used as stand alone programs were
> updated to use #!/usr/bin/python instead of #!/usr/bin/env python,
> complying with the rest of the autotest code base.
>
> Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
> ---
>  client/tests/kvm/fix_cdkeys.py   |    2 +-
>  client/tests/kvm/kvm_config.py   |    1 +
>  client/tests/kvm/scan_results.py |    2 +-
>  client/tests/kvm/stepeditor.py   |    2 +-
>  client/tests/kvm/stepmaker.py    |    2 +-
>  5 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/client/tests/kvm/fix_cdkeys.py b/client/tests/kvm/fix_cdkeys.py
> index 4f7a824..7f52c44 100755
> --- a/client/tests/kvm/fix_cdkeys.py
> +++ b/client/tests/kvm/fix_cdkeys.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/python
>  import shutil, os, sys
>
>  """
> diff --git a/client/tests/kvm/kvm_config.py b/client/tests/kvm/kvm_config.py
> index 40f16f1..a3467a0 100755
> --- a/client/tests/kvm/kvm_config.py
> +++ b/client/tests/kvm/kvm_config.py
> @@ -1,3 +1,4 @@
> +#!/usr/bin/python
>  import re, os, sys, StringIO
>  from autotest_lib.client.common_lib import error
>
> diff --git a/client/tests/kvm/scan_results.py b/client/tests/kvm/scan_results.py
> index 156b7d4..a92c867 100755
> --- a/client/tests/kvm/scan_results.py
> +++ b/client/tests/kvm/scan_results.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/python
>  """
>  Program that parses the autotest results and return a nicely printed final test
>  result.
> diff --git a/client/tests/kvm/stepeditor.py b/client/tests/kvm/stepeditor.py
> index 9669200..6fb371b 100755
> --- a/client/tests/kvm/stepeditor.py
> +++ b/client/tests/kvm/stepeditor.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/python
>  import pygtk, gtk, os, glob, shutil, sys, logging
>  import ppm_utils
>  pygtk.require('2.0')
> diff --git a/client/tests/kvm/stepmaker.py b/client/tests/kvm/stepmaker.py
> index 2b7fd54..a9ddf25 100644
> --- a/client/tests/kvm/stepmaker.py
> +++ b/client/tests/kvm/stepmaker.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/python
>  import pygtk, gtk, gobject, time, os, commands
>  from autotest_lib.client.common_lib import error
>  import kvm_utils, logging, ppm_utils, stepeditor
> --
> 1.6.2.2
>
> _______________________________________________
> Autotest mailing list
> Autotest@test.kernel.org
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lucas Meneghel Rodrigues June 10, 2009, 12:59 a.m. UTC | #2
On Tue, 2009-06-09 at 10:00 -0700, Martin Bligh wrote:
> I'd suggest you use the same mechanism as the other entry points,
> and override the python version where necessary - some distros
> have ancient or bleeding edge default Python versions.
> 
> see common.py -> setup_modules.py -> check_version.check_python_version

Done. Re-sent the patch of the stand alone programs. Thanks!

> On Tue, Jun 9, 2009 at 9:33 AM, Lucas Meneghel Rodrigues<lmr@redhat.com> wrote:
> > All kvm modules that can be used as stand alone programs were
> > updated to use #!/usr/bin/python instead of #!/usr/bin/env python,
> > complying with the rest of the autotest code base.
> >
> > Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
> > ---
> >  client/tests/kvm/fix_cdkeys.py   |    2 +-
> >  client/tests/kvm/kvm_config.py   |    1 +
> >  client/tests/kvm/scan_results.py |    2 +-
> >  client/tests/kvm/stepeditor.py   |    2 +-
> >  client/tests/kvm/stepmaker.py    |    2 +-
> >  5 files changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/client/tests/kvm/fix_cdkeys.py b/client/tests/kvm/fix_cdkeys.py
> > index 4f7a824..7f52c44 100755
> > --- a/client/tests/kvm/fix_cdkeys.py
> > +++ b/client/tests/kvm/fix_cdkeys.py
> > @@ -1,4 +1,4 @@
> > -#!/usr/bin/env python
> > +#!/usr/bin/python
> >  import shutil, os, sys
> >
> >  """
> > diff --git a/client/tests/kvm/kvm_config.py b/client/tests/kvm/kvm_config.py
> > index 40f16f1..a3467a0 100755
> > --- a/client/tests/kvm/kvm_config.py
> > +++ b/client/tests/kvm/kvm_config.py
> > @@ -1,3 +1,4 @@
> > +#!/usr/bin/python
> >  import re, os, sys, StringIO
> >  from autotest_lib.client.common_lib import error
> >
> > diff --git a/client/tests/kvm/scan_results.py b/client/tests/kvm/scan_results.py
> > index 156b7d4..a92c867 100755
> > --- a/client/tests/kvm/scan_results.py
> > +++ b/client/tests/kvm/scan_results.py
> > @@ -1,4 +1,4 @@
> > -#!/usr/bin/env python
> > +#!/usr/bin/python
> >  """
> >  Program that parses the autotest results and return a nicely printed final test
> >  result.
> > diff --git a/client/tests/kvm/stepeditor.py b/client/tests/kvm/stepeditor.py
> > index 9669200..6fb371b 100755
> > --- a/client/tests/kvm/stepeditor.py
> > +++ b/client/tests/kvm/stepeditor.py
> > @@ -1,4 +1,4 @@
> > -#!/usr/bin/env python
> > +#!/usr/bin/python
> >  import pygtk, gtk, os, glob, shutil, sys, logging
> >  import ppm_utils
> >  pygtk.require('2.0')
> > diff --git a/client/tests/kvm/stepmaker.py b/client/tests/kvm/stepmaker.py
> > index 2b7fd54..a9ddf25 100644
> > --- a/client/tests/kvm/stepmaker.py
> > +++ b/client/tests/kvm/stepmaker.py
> > @@ -1,4 +1,4 @@
> > -#!/usr/bin/env python
> > +#!/usr/bin/python
> >  import pygtk, gtk, gobject, time, os, commands
> >  from autotest_lib.client.common_lib import error
> >  import kvm_utils, logging, ppm_utils, stepeditor
> > --
> > 1.6.2.2
> >
> > _______________________________________________
> > Autotest mailing list
> > Autotest@test.kernel.org
> > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
> >
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexey Eromenko June 10, 2009, 11:01 a.m. UTC | #3
Even better would be to use "/usr/bin/python2".

This is because future distros will include python3, which is incompatible with python2 code.

"python" will be symlink of "python3".

-Alexey
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Martin Bligh June 10, 2009, 2:19 p.m. UTC | #4
On Wed, Jun 10, 2009 at 4:01 AM, Alexey Eromenko<aeromenk@redhat.com> wrote:
>
> Even better would be to use "/usr/bin/python2".

That doesn't seem to exist, on Ubuntu at least.

> This is because future distros will include python3, which is incompatible with python2 code.
>
> "python" will be symlink of "python3".
>
> -Alexey
>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexey Eromenko June 15, 2009, 1:35 p.m. UTC | #5
----- "Martin Bligh" <mbligh@google.com> wrote:

> On Wed, Jun 10, 2009 at 4:01 AM, Alexey Eromenko<aeromenk@redhat.com>
> wrote:
> >
> > Even better would be to use "/usr/bin/python2".
> 
> That doesn't seem to exist, on Ubuntu at least.
> 

Red Hat systems have it. "/usr/bin/python2" is a symlink to "/usr/bin/python" (which is python2 executable)

Is there any Ubuntu-compatible way of achieving this?

-Alexey
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lucas Meneghel Rodrigues June 15, 2009, 2:41 p.m. UTC | #6
On Mon, 2009-06-15 at 09:35 -0400, Alexey Eromenko wrote:
> ----- "Martin Bligh" <mbligh@google.com> wrote:
> 
> > On Wed, Jun 10, 2009 at 4:01 AM, Alexey Eromenko<aeromenk@redhat.com>
> > wrote:
> > >
> > > Even better would be to use "/usr/bin/python2".
> > 
> > That doesn't seem to exist, on Ubuntu at least.
> > 
> 
> Red Hat systems have it. "/usr/bin/python2" is a symlink to "/usr/bin/python" (which is python2 executable)
> 
> Is there any Ubuntu-compatible way of achieving this?
> 
> -Alexey

The patch I had already applied uses autotest code to figure the best
python interpreter anyway, so it won't use python 3 if it's installed,
it will prefer the 2.4 - 2.6 series...

> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Martin Bligh June 15, 2009, 3:58 p.m. UTC | #7
On Mon, Jun 15, 2009 at 6:35 AM, Alexey Eromenko<aeromenk@redhat.com> wrote:
>
> ----- "Martin Bligh" <mbligh@google.com> wrote:
>
>> On Wed, Jun 10, 2009 at 4:01 AM, Alexey Eromenko<aeromenk@redhat.com>
>> wrote:
>> >
>> > Even better would be to use "/usr/bin/python2".
>>
>> That doesn't seem to exist, on Ubuntu at least.
>>
>
> Red Hat systems have it. "/usr/bin/python2" is a symlink to "/usr/bin/python" (which is python2 executable)
>
> Is there any Ubuntu-compatible way of achieving this?

Not that I can see, other than explicit Python code, which we have already.
I think this is a solved issue?
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/client/tests/kvm/fix_cdkeys.py b/client/tests/kvm/fix_cdkeys.py
index 4f7a824..7f52c44 100755
--- a/client/tests/kvm/fix_cdkeys.py
+++ b/client/tests/kvm/fix_cdkeys.py
@@ -1,4 +1,4 @@ 
-#!/usr/bin/env python
+#!/usr/bin/python
 import shutil, os, sys
 
 """
diff --git a/client/tests/kvm/kvm_config.py b/client/tests/kvm/kvm_config.py
index 40f16f1..a3467a0 100755
--- a/client/tests/kvm/kvm_config.py
+++ b/client/tests/kvm/kvm_config.py
@@ -1,3 +1,4 @@ 
+#!/usr/bin/python
 import re, os, sys, StringIO
 from autotest_lib.client.common_lib import error
 
diff --git a/client/tests/kvm/scan_results.py b/client/tests/kvm/scan_results.py
index 156b7d4..a92c867 100755
--- a/client/tests/kvm/scan_results.py
+++ b/client/tests/kvm/scan_results.py
@@ -1,4 +1,4 @@ 
-#!/usr/bin/env python
+#!/usr/bin/python
 """
 Program that parses the autotest results and return a nicely printed final test
 result.
diff --git a/client/tests/kvm/stepeditor.py b/client/tests/kvm/stepeditor.py
index 9669200..6fb371b 100755
--- a/client/tests/kvm/stepeditor.py
+++ b/client/tests/kvm/stepeditor.py
@@ -1,4 +1,4 @@ 
-#!/usr/bin/env python
+#!/usr/bin/python
 import pygtk, gtk, os, glob, shutil, sys, logging
 import ppm_utils
 pygtk.require('2.0')
diff --git a/client/tests/kvm/stepmaker.py b/client/tests/kvm/stepmaker.py
index 2b7fd54..a9ddf25 100644
--- a/client/tests/kvm/stepmaker.py
+++ b/client/tests/kvm/stepmaker.py
@@ -1,4 +1,4 @@ 
-#!/usr/bin/env python
+#!/usr/bin/python
 import pygtk, gtk, gobject, time, os, commands
 from autotest_lib.client.common_lib import error
 import kvm_utils, logging, ppm_utils, stepeditor