misc: Correct jenkins_job_env.py on SLES nodes
authorKienan Stewart <kstewart@efficios.com>
Tue, 19 Mar 2024 20:20:07 +0000 (16:20 -0400)
committerKienan Stewart <kstewart@efficios.com>
Tue, 19 Mar 2024 20:20:07 +0000 (16:20 -0400)
The `required` argument to `parser.add_subparser` is only introduced
in Python 3.7. SLE15SP4 has Python 3.6.

`platform.architecture` is a method that needs to be called.

Change-Id: Ie5ba39d94763701af15848d6bed66b16bede524d
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
scripts/jenkins_job_env.py

index 82401dce2e89cf929b4178f7bbc97adee5a0b85a..0607f38be4828928262fd13cd360771ae7ebb668 100755 (executable)
@@ -34,7 +34,7 @@ def _get_argparser():
         description="Fetch and create a stub environment from common job artifacts",
     )
     # Commands: fetch (implies activate), activate, deactivate
-    subparsers = parser.add_subparsers(required=True, dest="command")
+    subparsers = parser.add_subparsers(dest="command")
     parser.add_argument(
         "-v", "--verbose", action="count", help="Increase the verbosity"
     )
@@ -111,7 +111,7 @@ def fetch(destination, server, job, build, job_configuration=None, download=True
             pathlib.Path("/etc/products.d/SLES.prod").exists()
             or pathlib.Path("/etc/redhat-release").exists()
             or pathlib.Path("/etc/yocto-release").exists()
-        ) and "64bit" in platform.architecture:
+        ) and "64bit" in platform.architecture():
             lib_dir_arch = "{}64"
 
         so_re = re.compile("^.*\.so\.\d+\.\d+\.\d+$")
@@ -140,7 +140,7 @@ def create_activate(destination):
         pathlib.Path("/etc/products.d/SLES.prod").exists()
         or pathlib.Path("/etc/redhat-release").exists()
         or pathlib.Path("/etc/yocto-release").exists()
-    ) and "64bit" in platform.architecture:
+    ) and "64bit" in platform.architecture():
         lib_dir_arch = "{}64"
 
     env = {}
This page took 0.024191 seconds and 4 git commands to generate.