Bug 1303282

Summary: virt-manager shebang hardcoded to /usr/bin/python2
Product: [Community] Virtualization Tools Reporter: Jeffrey Walton <noloader>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED UPSTREAM QA Contact:
Severity: low Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, gscrivan, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Mac OS   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-17 17:01:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jeffrey Walton 2016-01-30 05:51:18 UTC
Clone of Virt-Manager (https://virt-manager.org/) from GitHub (https://github.com/virt-manager/virt-manager.git). According to INSTALL:

    $ cat INSTALL
      Basic Install
      =============

    For starters, if you just want to run virt-manager/virt-install
    to test out changes, it can be done from the source directory:

        ./virt-manager

Attempting to run it on OS X results in:

    $ ./virt-manager 
    -bash: ./virt-manager: /usr/bin/python2: bad interpreter: No
    such file or directory

According to http://unix.stackexchange.com/a/94198/56041, the expected way to specify Python2 is:

    #!/usr/bin/env python2

It appears to get me past the initial error.

My apologies for the bug. I think this is a trivial improvement, and it should be labeled an enhancement or similar. "Low" bug was as low as I could go...

**********

$ git diff
diff --git a/virt-manager b/virt-manager
index 7a2105f..66dbdc5 100755
--- a/virt-manager
+++ b/virt-manager
@@ -1,4 +1,4 @@
-#!/usr/bin/python2 -tt
+#!/usr/bin/env python2 -tt
 #
 # Copyright (C) 2006, 2014 Red Hat, Inc.
 # Copyright (C) 2006 Daniel P. Berrange <berrange>

Comment 1 Cole Robinson 2016-06-17 17:01:23 UTC
Thanks for the report, fixed upstream now:

commit 47dd38eb3eb604b72687afec7463c7303caac133
Author: Cole Robinson <crobinso>
Date:   Fri Jun 17 12:56:14 2016 -0400

    Use #!/usr/bin/env for python scripts
    
    This is recommended for upstream, but not for downstream, like Fedora.
    So change /usr/bin/env to /usr/bin/python2 at RPM install time to
    match the ideal Fedora config.
    
    https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython
    https://bugzilla.redhat.com/show_bug.cgi?id=1303282