[Git][NTPsec/ntpsec][master] 2 commits: Update python binary name for py2 in deb_old_option_tester CI template

Matt Selsky (@selsky) gitlab at mg.gitlab.com
Tue Jun 20 04:37:04 UTC 2023



Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
25a67d41 by Matt Selsky at 2023-06-20T00:03:23-04:00
Update python binary name for py2 in deb_old_option_tester CI template

- - - - -
558108dc by Matt Selsky at 2023-06-20T00:36:21-04:00
Update ntpsnmpd to use python built-in to get uname information

Previously there was an error due to data being read in binary mode instead of
text mode.

Fixes NTPsec/ntpsec#791

- - - - -


3 changed files:

- .gitlab-opttest-ci.yml
- NEWS.adoc
- ntpclients/ntpsnmpd.py


Changes:

=====================================
.gitlab-opttest-ci.yml
=====================================
@@ -126,7 +126,7 @@ freebsd-options-tester:
   script:
     - apt-get update
     - apt-get install -y netbase bison gcc libssl-dev libcap-dev pps-tools python2-dev python2-minimal libseccomp-dev bash pkg-config python3-dev python3-minimal
-    - PYTHON=python bash tests/option-tester.sh
+    - PYTHON=python2 bash tests/option-tester.sh
     - PYTHON=python3 bash tests/option-tester.sh
   tags:
     - gitlab-org


=====================================
NEWS.adoc
=====================================
@@ -12,6 +12,8 @@ on user-visible changes.
 
 ## Repository Head
 
+* Update ntpsnmpd to use python built-in to get uname information. NTPsec/ntpsec#791
+
 * Update license file names for REUSE compliance.
 
 * Fix ntploggps issue where count_used_satellites checked before it is initialized.


=====================================
ntpclients/ntpsnmpd.py
=====================================
@@ -8,7 +8,6 @@ import os
 import getopt
 import time
 import socket
-import subprocess
 
 try:
     import ntp.packet
@@ -193,9 +192,9 @@ class DataSource(ntp.agentx.MIBControl):
         elif category == "vendor":  # vendor/author name
             data = "Internet Civil Engineering Institute"
         elif category == "system":  # system / hardware info
-            proc = subprocess.Popen(["uname", "-srm"],
-                                    stdout=subprocess.PIPE)
-            data = proc.communicate()[0]
+            # Extract sysname, release, machine from os.uname() tuple
+            uname = os.uname()
+            data = " ".join([uname[0], uname[2], uname[4]])
         vb = ax.Varbind(ax.VALUE_OCTET_STR, oid, data)
         return vb
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/a61ddcf296c92904cfb410c0afd24a48b8bf4613...558108dcb10b2da1041311ae913e842f0a5a7fbe

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/a61ddcf296c92904cfb410c0afd24a48b8bf4613...558108dcb10b2da1041311ae913e842f0a5a7fbe
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20230620/4919a557/attachment-0001.htm>


More information about the vc mailing list