Ambari
  1. Ambari
  2. AMBARI-1790

Consider changing env comments in py scripts to use 'python' instead of 'python2.x'

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Fedora
      Using branch-1.2 sources

      Description

      The env comment in most of the python files looks like

      #!/usr/bin/env python2.6

      Changing it to this makes the scripts work on hosts with python2.7 which is more portable

      #!/usr/bin/env python

      1. python_ver.patch
        71 kB
        Trevor McKay

        Activity

        Trevor McKay created issue -
        Hide
        Trevor McKay added a comment -

        Attached is a patch to change the py files in branch-1.2, it shows the affected files.

        Show
        Trevor McKay added a comment - Attached is a patch to change the py files in branch-1.2, it shows the affected files.
        Trevor McKay made changes -
        Field Original Value New Value
        Attachment python2.patch [ 12577031 ]
        Mahadev konar made changes -
        Fix Version/s 1.3.0 [ 12323930 ]
        Hide
        Mahadev konar added a comment -

        Nice one Trevor.

        Can you also provide a patch for trunk?

        Show
        Mahadev konar added a comment - Nice one Trevor. Can you also provide a patch for trunk?
        Mahadev konar made changes -
        Assignee Trevor McKay [ tmckay ]
        Hide
        Trevor McKay added a comment -

        Attaching the analogous patch for trunk

        Show
        Trevor McKay added a comment - Attaching the analogous patch for trunk
        Trevor McKay made changes -
        Attachment python2_trunk.patch [ 12577537 ]
        Hide
        Sumit Mohanty added a comment -

        +1

        Show
        Sumit Mohanty added a comment - +1
        Trevor McKay made changes -
        Attachment python2.patch [ 12577031 ]
        Hide
        Trevor McKay added a comment -

        Recreating the python2.patch for branch-1.2. For some reason my svn status was not right; I had played with changing the python version to 2.7 at some point and the patch reflected that.

        This one moves python2.6 -> python2

        Show
        Trevor McKay added a comment - Recreating the python2.patch for branch-1.2. For some reason my svn status was not right; I had played with changing the python version to 2.7 at some point and the patch reflected that. This one moves python2.6 -> python2
        Trevor McKay made changes -
        Attachment python2.patch [ 12577542 ]
        Trevor McKay made changes -
        Description The env comment in most of the python files looks like

        #!/usr/bin/env python2.7

        Changing it to this makes the scripts work on hosts with python2.x which is more portable

        #!/usr/bin/env python2
        The env comment in most of the python files looks like

        #!/usr/bin/env python2.6

        Changing it to this makes the scripts work on hosts with python2.x which is more portable

        #!/usr/bin/env python2
        Mahadev konar made changes -
        Fix Version/s 1.2.3 [ 12324283 ]
        Fix Version/s 1.3.0 [ 12323930 ]
        Yusaku Sako made changes -
        Fix Version/s 1.3.0 [ 12323930 ]
        Fix Version/s 1.2.3 [ 12324283 ]
        Yusaku Sako made changes -
        Fix Version/s 1.3.0 [ 12323930 ]
        Trevor McKay made changes -
        Summary Consider changing env comments in py scripts to use python2 instead of python2.x Consider changing env comments in py scripts to use 'python' instead of 'python2.x'
        Trevor McKay made changes -
        Description The env comment in most of the python files looks like

        #!/usr/bin/env python2.6

        Changing it to this makes the scripts work on hosts with python2.x which is more portable

        #!/usr/bin/env python2
        The env comment in most of the python files looks like

        #!/usr/bin/env python2.6

        Changing it to this makes the scripts work on hosts with python2.7 which is more portable

        #!/usr/bin/env python
        Trevor McKay made changes -
        Attachment python2.patch [ 12577542 ]
        Trevor McKay made changes -
        Attachment python2_trunk.patch [ 12577537 ]
        Hide
        Trevor McKay added a comment -

        Redo the patch:

        1) Chagne "python2.6" to "python" instead of python2 as previous. Some platforms, like MacOS, don't provide the python2 link

        2) apply to current trunk

        Show
        Trevor McKay added a comment - Redo the patch: 1) Chagne "python2.6" to "python" instead of python2 as previous. Some platforms, like MacOS, don't provide the python2 link 2) apply to current trunk
        Trevor McKay made changes -
        Attachment python_ver.patch [ 12610562 ]
        Hide
        Chad Roberts added a comment -

        This will greatly improve things when it comes to building on Fedora and other platforms.

        +1

        Show
        Chad Roberts added a comment - This will greatly improve things when it comes to building on Fedora and other platforms. +1
        Hide
        Trevor McKay added a comment -

        Updated against trunk

        Show
        Trevor McKay added a comment - Updated against trunk
        Trevor McKay made changes -
        Attachment python_ver.patch [ 12617844 ]
        Trevor McKay made changes -
        Attachment python_ver.patch [ 12610562 ]
        Hide
        Chad Roberts added a comment -

        Committed to trunk.

        Show
        Chad Roberts added a comment - Committed to trunk.
        Chad Roberts made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        248d 21h 39m 1 Chad Roberts 09/Dec/13 16:16

          People

          • Assignee:
            Trevor McKay
            Reporter:
            Trevor McKay
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development