linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Nandaa <profnandaa@gmail.com>
To: linux-hyperv@vger.kernel.org, decui@microsoft.com, mhklinux@outlook.com
Cc: kys@microsoft.com, Anthony Nandaa <profnandaa@gmail.com>
Subject: [PATCH] tools: hv: lsvmbus: change shebang to use python3
Date: Mon,  1 Jul 2024 08:35:55 +0000	[thread overview]
Message-ID: <20240701083554.11967-1-profnandaa@gmail.com> (raw)

This patch updates the shebang in the lsvmbus tool to use python3
instead of python. The change is necessary because Python 2 has
reached its end of life as of January 1, 2020, and is no longer
maintained[1]. Many modern systems do not have python pointing to
Python 2, and instead use python3.

By explicitly using python3, we ensure compatibility with modern
systems since Python 2 is no longer being shipped by default.

This change also updates the file permissions to make the script
executable, so that the script runs out of the box.
Also, similar scripts within `tools/hv` have mode `755`:

```
-rwxr-xr-x 1 labuser labuser   930 Jun 28 16:15 hv_get_dhcp_info.sh
-rwxr-xr-x 1 labuser labuser   622 Jun 28 16:15 hv_get_dns_info.sh
-rwxr-xr-x 1 labuser labuser  1888 Jun 28 16:15 hv_set_ifconfig.sh
```

Before fix, this is what you get when you attempt to run `lsvmbus`:
```
/usr/bin/env: ‘python’: No such file or directory
```

[1] https://www.python.org/doc/sunset-python-2/

Signed-off-by: Anthony Nandaa <profnandaa@gmail.com>
---
 tools/hv/lsvmbus | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 tools/hv/lsvmbus

diff --git a/tools/hv/lsvmbus b/tools/hv/lsvmbus
old mode 100644
new mode 100755
index 55e7374bade0..23dcd8e705be
--- a/tools/hv/lsvmbus
+++ b/tools/hv/lsvmbus
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0
 
 import os
-- 
2.33.8


             reply	other threads:[~2024-07-01  8:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  8:35 Anthony Nandaa [this message]
2024-07-01 20:40 ` [PATCH] tools: hv: lsvmbus: change shebang to use python3 Wei Liu
2024-07-02  9:32   ` Anthony Nandaa
2024-07-02  3:15 ` Michael Kelley
2024-07-02  9:29   ` Anthony Nandaa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240701083554.11967-1-profnandaa@gmail.com \
    --to=profnandaa@gmail.com \
    --cc=decui@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=mhklinux@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).