5 Commits

Author SHA256 Message Date
da1bc0a5d8 Accepting request 1299247 from hardware
OBS-URL: https://build.opensuse.org/request/show/1299247
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/nut?expand=0&rev=83
2025-08-13 16:16:05 +00:00
824a958abb - Update to 2.8.4:
https://github.com/networkupstools/nut/releases/tag/v2.8.4
  For more see NEWS.adoc and UPGRADING.adoc in /usr/share/doc/packages/nut
- Add new manpage files
- Remove patches included in upstream release
  * fix-upsd-buffer-overflow.patch
  * fix-usbhid-ups-commands.patch
- Bump libnutscan3 suffix with new SONAME, now libnutscan4

OBS-URL: https://build.opensuse.org/package/show/hardware/nut?expand=0&rev=122
2025-08-13 14:05:07 +00:00
c7940f2055 Accepting request 1291260 from hardware
OBS-URL: https://build.opensuse.org/request/show/1291260
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/nut?expand=0&rev=82
2025-07-09 15:27:17 +00:00
cc610a8cdf Accepting request 1291259 from home:ateixeira:branches:hardware
OBS-URL: https://build.opensuse.org/request/show/1291259
OBS-URL: https://build.opensuse.org/package/show/hardware/nut?expand=0&rev=120
2025-07-08 12:35:40 +00:00
0e7c78d951 Accepting request 1290531 from home:ateixeira:branches:hardware
- Update to 2.8.3:
  https://github.com/networkupstools/nut/releases/tag/v2.8.3
  For more see NEWS.adoc and UPGRADING.adoc in /usr/share/doc/packages/nut
- Use upstream sources directly instead of repacking, license issues with
  Eaton scripts have been fixed (files have been relicensed to the GPL)
- SO version bump for libnutscan and libupsclient
- Package new library libnutconf
- Add %service_* calls for new systemd units
- Install html-doc through build system instead of manually
  * html-doc files have been moved to /usr/share/doc/packages/nut/html-doc
- Move python files to %python_sitelib
- Drop pynut-replace-telnetlib.patch
  * Included in upstream release
- Package systemd preset files
- Refresh patches
  * nut-doc-fixed-date.patch
  * harden_nut-server.service.patch
  * harden_nut-monitor.service.patch
  * harden_nut-driver.service.patch
- Add patches
  * fix-upsd-buffer-overflow.patch
    Fixes some portability problems and potential buffer overflow in upsd
  * fix-usbhid-ups-commands.patch
    Fixes failing commands with usbhid-ups

OBS-URL: https://build.opensuse.org/request/show/1290531
OBS-URL: https://build.opensuse.org/package/show/hardware/nut?expand=0&rev=119
2025-07-07 13:43:36 +00:00
10 changed files with 143 additions and 612 deletions

View File

@@ -1,7 +1,8 @@
diff -purN a/scripts/systemd/nut-driver@.service.in b/scripts/systemd/nut-driver@.service.in
--- a/scripts/systemd/nut-driver@.service.in 2023-10-07 16:06:44.000000000 +0200
+++ b/scripts/systemd/nut-driver@.service.in 2023-11-03 19:46:30.856267504 +0100
@@ -46,6 +46,17 @@ PartOf=nut-driver.target
Index: b/scripts/systemd/nut-driver@.service.in
===================================================================
--- a/scripts/systemd/nut-driver@.service.in
+++ b/scripts/systemd/nut-driver@.service.in
@@ -53,6 +53,17 @@ Documentation=@NUT_WEBSITE_BASE@/docs/ma
# Finally note that "nut-driver-enumerator.service" should take care of this.
[Service]
@@ -17,5 +18,5 @@ diff -purN a/scripts/systemd/nut-driver@.service.in b/scripts/systemd/nut-driver
+RestrictRealtime=true
+# end of automatic additions
Environment=NUT_IGNORE_NOWAIT=true
Environment=NUT_QUIET_INIT_NDE_WARNING=true
EnvironmentFile=-@CONFPATH@/nut.conf
SyslogIdentifier=%N

View File

@@ -1,8 +1,9 @@
diff -purN a/scripts/systemd/nut-monitor.service.in b/scripts/systemd/nut-monitor.service.in
--- a/scripts/systemd/nut-monitor.service.in 2023-10-07 16:06:44.000000000 +0200
+++ b/scripts/systemd/nut-monitor.service.in 2023-11-03 19:48:16.280004811 +0100
@@ -25,6 +25,17 @@ Wants=nut-server.service
PartOf=nut.target
Index: b/scripts/systemd/nut-monitor.service.in
===================================================================
--- a/scripts/systemd/nut-monitor.service.in
+++ b/scripts/systemd/nut-monitor.service.in
@@ -32,6 +32,17 @@ Documentation=man:nut.conf(@MAN_SECTION_
Documentation=@NUT_WEBSITE_BASE@/docs/man/nut.conf.html
[Service]
+# added automatically, for details please see

View File

@@ -1,8 +1,9 @@
diff -purN a/scripts/systemd/nut-server.service.in b/scripts/systemd/nut-server.service.in
--- a/scripts/systemd/nut-server.service.in 2023-10-07 16:06:44.000000000 +0200
+++ b/scripts/systemd/nut-server.service.in 2023-11-03 19:49:51.496940092 +0100
@@ -26,6 +26,17 @@ Before=nut-monitor.service
PartOf=nut.target
Index: b/scripts/systemd/nut-server.service.in
===================================================================
--- a/scripts/systemd/nut-server.service.in
+++ b/scripts/systemd/nut-server.service.in
@@ -37,6 +37,17 @@ Documentation=man:nut.conf(@MAN_SECTION_
Documentation=@NUT_WEBSITE_BASE@/docs/man/nut.conf.html
[Service]
+# added automatically, for details please see
@@ -18,4 +19,4 @@ diff -purN a/scripts/systemd/nut-server.service.in b/scripts/systemd/nut-server.
+# end of automatic additions
# A busy server can be monitoring a lot of devices as well as replying
# to many clients. The "infinity" definition is actually capped by OS
# settings and hardcoded defaults; typically can be 65535+ nowadays.
# settings and hard-coded defaults; typically can be 65535+ nowadays.

Binary file not shown.

3
nut-2.8.4.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0130ba82ea79f04ba4f34c5249a85943977efd984ed7df6aec1a518d5a3594f8
size 6522704

BIN
nut-2.8.4.tar.gz.sig Normal file

Binary file not shown.

View File

@@ -1,7 +1,8 @@
diff -purN a/docs/Makefile.am b/docs/Makefile.am
--- a/docs/Makefile.am 2023-10-16 10:06:18.000000000 +0200
+++ b/docs/Makefile.am 2023-11-03 19:40:55.360576893 +0100
@@ -248,8 +248,8 @@ solaris-usb.html solaris-usb.chunked sol
Index: b/docs/Makefile.am
===================================================================
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -592,8 +592,8 @@ A2X_DOCINFO_DIR=$(builddir)
A2X_COMMON_OPTS = $(ASCIIDOC_VERBOSE) \
--attribute=icons \
--xsltproc-opts="--nonet" \
@@ -9,20 +10,22 @@ diff -purN a/docs/Makefile.am b/docs/Makefile.am
- --xsltproc-opts="--stringparam nut.localtime \"`TZ=UTC date +%H:%M:%S`\"" \
+ --xsltproc-opts "--stringparam nut.localdate \"`TZ=UTC date +%Y-%m-%d -r $(top_srcdir)/ChangeLog`\"" \
+ --xsltproc-opts "--stringparam nut.localtime \"`TZ=UTC date +%H:%M:%S -r $(top_srcdir)/ChangeLog`\"" \
--xsltproc-opts="--stringparam nut.nutversion \"@PACKAGE_VERSION@\"" \
--attribute=docinfodir="$(builddir)" \
--xsltproc-opts="--stringparam nut.nutversion \"$(PACKAGE_VERSION)\"" \
--attribute=docinfodir="$${A2X_DOCINFO_DIR}" \
--attribute=iconsdir="$(srcdir)/images" \
diff -purN a/docs/man/Makefile.am b/docs/man/Makefile.am
--- a/docs/man/Makefile.am 2023-10-24 10:45:21.000000000 +0200
+++ b/docs/man/Makefile.am 2023-11-03 19:41:55.114481978 +0100
@@ -999,8 +999,8 @@ DOCBUILD_END = { \
echo " DOC-MAN-HTML Generating $@"; \
Index: b/docs/man/Makefile.am
===================================================================
--- a/docs/man/Makefile.am
+++ b/docs/man/Makefile.am
@@ -1602,9 +1602,9 @@ DOCBUILD_END = { \
echo " DOC-MAN-HTML Generating $@"; \
$(DOCBUILD_BEGIN) ; RES=0; \
$(ASCIIDOC) --backend=xhtml11 $${A2X_VERBOSE} \
- --attribute localdate="`TZ=UTC date +%Y-%m-%d`" \
- --attribute localtime="`TZ=UTC date +%H:%M:%S`" \
+ --attribute localdate=`TZ=UTC date +%Y-%m-%d -r $(top_srcdir)/ChangeLog` \
+ --attribute localtime=`TZ=UTC date +%H:%M:%S -r $(top_srcdir)/ChangeLog` \
--attribute nutversion="@PACKAGE_VERSION@" \
--attribute srcdir="$(abs_srcdir)/" \
--attribute builddir="$(abs_builddir)/" \
- --attribute=localdate="`TZ=UTC date +%Y-%m-%d`" \
- --attribute=localtime="`TZ=UTC date +%H:%M:%S`" \
+ --attribute=localdate=`TZ=UTC date +%Y-%m-%d -r $(top_srcdir)/ChangeLog` \
+ --attribute=localtime=`TZ=UTC date +%H:%M:%S -r $(top_srcdir)/ChangeLog` \
--attribute=nutversion="$(PACKAGE_VERSION)" \
--attribute=srcdir="$(abs_srcdir)/" \
--attribute=builddir="$(abs_builddir)/" \
--attribute=top_srcdir="$(abs_top_srcdir)/" \

View File

@@ -1,3 +1,43 @@
-------------------------------------------------------------------
Tue Aug 12 15:13:04 UTC 2025 - Antonio Teixeira <antonio.teixeira@suse.com>
- Update to 2.8.4:
https://github.com/networkupstools/nut/releases/tag/v2.8.4
For more see NEWS.adoc and UPGRADING.adoc in /usr/share/doc/packages/nut
- Add new manpage files
- Remove patches included in upstream release
* fix-upsd-buffer-overflow.patch
* fix-usbhid-ups-commands.patch
- Bump libnutscan3 suffix with new SONAME, now libnutscan4
-------------------------------------------------------------------
Thu Jul 3 14:06:13 UTC 2025 - Antonio Teixeira <antonio.teixeira@suse.com>
- Update to 2.8.3:
https://github.com/networkupstools/nut/releases/tag/v2.8.3
For more see NEWS.adoc and UPGRADING.adoc in /usr/share/doc/packages/nut
- Use upstream sources directly instead of repacking, license issues with
Eaton scripts have been fixed (files have been relicensed to the GPL)
- SO version bump for libnutscan and libupsclient
- Package new library libnutconf
- Add %service_* calls for new systemd units
- Install html-doc through build system instead of manually
* html-doc files have been moved to /usr/share/doc/packages/nut/html-doc
- Move python files to %python_sitelib
- Drop pynut-replace-telnetlib.patch
* Included in upstream release
- Package systemd preset files
- Refresh patches
* nut-doc-fixed-date.patch
* harden_nut-server.service.patch
* harden_nut-monitor.service.patch
* harden_nut-driver.service.patch
- Add patches
* fix-upsd-buffer-overflow.patch
Fixes some portability problems and potential buffer overflow in upsd
* fix-usbhid-ups-commands.patch
Fixes failing commands with usbhid-ups
-------------------------------------------------------------------
Tue Apr 1 19:22:22 UTC 2025 - Antonio Teixeira <antonio.teixeira@suse.com>

100
nut.spec
View File

@@ -1,7 +1,8 @@
#
# spec file for package nut
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -55,14 +56,14 @@
%bcond_with libfreeipmi
%endif
Name: nut
Version: 2.8.2
Version: 2.8.4
Release: 0
Summary: Network UPS Tools Core (Uninterruptible Power Supply Monitoring)
License: GPL-2.0-or-later
Group: Hardware/UPS
URL: https://www.networkupstools.org/
# Repack with upstream PR #2623 patched in due to files with proprietary license
Source0: %{name}-%{version}-repack.tar.gz
Source0: https://github.com/networkupstools/nut/releases/download/v%{version}/%{name}-%{version}.tar.gz
Source1: https://github.com/networkupstools/nut/releases/download/v%{version}/%{name}-%{version}.tar.gz.sig
Source2: README.SUSE
Source3: nut.rpmlintrc
Source4: nut.keyring
@@ -74,9 +75,6 @@ Patch2: nut-doc-fixed-date.patch
Patch3: harden_nut-driver.service.patch
Patch4: harden_nut-monitor.service.patch
Patch5: harden_nut-server.service.patch
# PATCH-FIX-UPSTREAM pynut-replace-telnetlib.patch antonio.teixeira@suse.com -- Removes dependency on telnetlib module which was removed in python 3.13.
# Backported from https://github.com/networkupstools/nut/pull/2792
Patch6: pynut-replace-telnetlib.patch
BuildRequires: apache-rpm-macros
BuildRequires: asciidoc
BuildRequires: fdupes
@@ -166,23 +164,23 @@ Shared library for the Network UPS Tools.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package -n libnutscan2
%package -n libnutscan4
Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring)
Group: System/Libraries
Conflicts: libupsclient1
%description -n libnutscan2
%description -n libnutscan4
Shared library for the Network UPS Tools.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package -n libupsclient6
%package -n libupsclient7
Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring)
Group: System/Libraries
Conflicts: libupsclient1
%description -n libupsclient6
%description -n libupsclient7
Shared library for the Network UPS Tools.
Network UPS Tools is a collection of programs which provide a common
@@ -199,6 +197,16 @@ Shared library for the Network UPS Tools.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package -n libnutconf0
Summary: Network UPS Tools Library (Uninterruptible Power Supply Monitoring)
Group: System/Libraries
%description -n libnutconf0
Shared library for the Network UPS Tools.
Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering UPS hardware.
%package cgi
Summary: Network UPS Tools Web Server Support (UPS Status Pages)
Group: Hardware/UPS
@@ -219,8 +227,9 @@ Summary: Network UPS Tools (Uninterruptible Power Supply Monitoring)
Group: Development/Libraries/C and C++
Requires: libnutclient2 = %{version}-%{release}
Requires: libnutclientstub1 = %{version}-%{release}
Requires: libnutscan2 = %{version}-%{release}
Requires: libupsclient6 = %{version}-%{release}
Requires: libnutconf0 = %{version}-%{release}
Requires: libnutscan4 = %{version}-%{release}
Requires: libupsclient7 = %{version}-%{release}
Requires: pkgconfig(openssl)
%description devel
@@ -322,6 +331,7 @@ sed -i s/@now@/`date -r ChangeLog +%%Y-%%m-%%d`/g docs/docinfo.xml.in
%build
autoreconf -fvi
%configure \
--docdir=%{_docdir}/%{name} \
--disable-static \
--sysconfdir=%{CONFPATH} \
--datadir=%{_datadir}/%{name} \
@@ -378,24 +388,23 @@ install -D -m 644 scripts/misc/nut.bash_completion %{buildroot}%{bashcompletions
# Documentation
cp -a docs/*.txt docs/cables docs/images %{buildroot}%{_docdir}/%{name}/
cp -a docs/*.css docs/*.html %{buildroot}%{_docdir}/%{name}/
%if %{with texdoc}
cp -a docs/*.pdf %{buildroot}%{_docdir}/%{name}/
%endif
cp -a docs/*.css %{buildroot}%{_docdir}/%{name}/html-doc
# Not needed for packaged contents:
rm -f %{buildroot}%{_docdir}/%{name}/packager-guide.*
rm -f %{buildroot}%{_docdir}/%{name}/html-doc/packager-guide.html
rm -f %{buildroot}%{_docdir}/%{name}/cables/Makefile*
rm -f %{buildroot}%{_docdir}/%{name}/cables/*.txt-prepped
# Create symlinks for man pages
%fdupes -s %{buildroot}%{_mandir}
%fdupes %{buildroot}%{_docdir}/%{name}
%pre
%if 0%{?suse_version} < 1330
getent passwd %{NUT_USER} >/dev/null || useradd -r -g %{NUT_GROUP} -s /bin/false -c "UPS daemon" -d /sbin %{NUT_USER} 2>/dev/null
%endif
%service_add_pre nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target nut-driver-enumerator-daemon-activator.path nut-driver-enumerator-daemon-activator.service nut-driver-enumerator-daemon.service
%service_add_pre nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target nut-driver-enumerator-daemon-activator.path nut-driver-enumerator-daemon-activator.service nut-driver-enumerator-daemon.service nut-logger.service nut-udev-settle.service
%post
# Generate initial passwords.
@@ -420,29 +429,32 @@ if grep "powersave -U" %{_sysconfdir}/ups/upsmon.conf ; then
fi
# And finally trigger udev to set permissions according to newly installed rules files.
udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%service_add_post nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target nut-driver-enumerator-daemon-activator.path nut-driver-enumerator-daemon-activator.service nut-driver-enumerator-daemon.service
%service_add_post nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target nut-driver-enumerator-daemon-activator.path nut-driver-enumerator-daemon-activator.service nut-driver-enumerator-daemon.service nut-logger.service nut-udev-settle.service
%tmpfiles_create %{_tmpfilesdir}/%{name}-common-tmpfiles.conf
%preun
%service_del_preun nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target nut-driver-enumerator-daemon-activator.path nut-driver-enumerator-daemon-activator.service nut-driver-enumerator-daemon.service
%service_del_preun nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target nut-driver-enumerator-daemon-activator.path nut-driver-enumerator-daemon-activator.service nut-driver-enumerator-daemon.service nut-logger.service nut-udev-settle.service
%postun
%service_del_postun nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target nut-driver-enumerator-daemon-activator.path nut-driver-enumerator-daemon-activator.service nut-driver-enumerator-daemon.service
%service_del_postun nut-server.service nut-monitor.service nut-driver-enumerator.path nut-driver-enumerator.service nut-driver.target nut.target nut-driver-enumerator-daemon-activator.path nut-driver-enumerator-daemon-activator.service nut-driver-enumerator-daemon.service nut-logger.service nut-udev-settle.service
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
%ldconfig_scriptlets -n libnutclient2
%ldconfig_scriptlets -n libnutclientstub1
%ldconfig_scriptlets -n libnutscan2
%ldconfig_scriptlets -n libupsclient6
%ldconfig_scriptlets -n libnutscan4
%ldconfig_scriptlets -n libupsclient7
%ldconfig_scriptlets -n libnutconf0
%else
%post -n libnutclient2 -p /sbin/ldconfig
%postun -n libnutclient2 -p /sbin/ldconfig
%post -n libnutclientstub1 -p /sbin/ldconfig
%postun -n libnutclientstub1 -p /sbin/ldconfig
%post -n libnutscan2 -p /sbin/ldconfig
%postun -n libnutscan2 -p /sbin/ldconfig
%post -n libupsclient6 -p /sbin/ldconfig
%postun -n libupsclient6 -p /sbin/ldconfig
%post -n libnutscan4 -p /sbin/ldconfig
%postun -n libnutscan4 -p /sbin/ldconfig
%post -n libupsclient7 -p /sbin/ldconfig
%postun -n libupsclient7 -p /sbin/ldconfig
%post -n libnutconf0 -p /sbin/ldconfig
%postun -n libnutconf0 -p /sbin/ldconfig
%endif
%files
@@ -452,12 +464,13 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%{_bindir}/*
%{_datadir}/%{name}
%{_mandir}/man5/*%{ext_man}
%{_mandir}/man7/*%{ext_man}
%{_mandir}/man8/*%{ext_man}
%exclude %{_mandir}/man8/netxml-ups*.*
%exclude %{_mandir}/man8/snmp-ups*.*
%dir %{_libexecdir}/ups
%{_libexecdir}/nut-driver-enumerator.sh
%python_sitearch/PyNUT.py
%python_sitelib/PyNUT.py
%{_sbindir}/*
%{_udevrulesdir}/*.rules
%config(noreplace) %{CONFPATH}/hosts.conf
@@ -477,6 +490,7 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%{_unitdir}/*.path
%{_unitdir}/*.target
%{_unitdir}/*.service
%{_presetdir}/*.preset
%{systemdsystemdutildir}/system-shutdown/*
%{systemdsystemdutildir}/system-sleep/%{name}.sh
%{bashcompletionsdir}/*
@@ -496,12 +510,15 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%files -n libnutclientstub1
%{_libdir}/libnutclientstub.so.*
%files -n libnutscan2
%files -n libnutscan4
%{_libdir}/libnutscan.so.*
%files -n libupsclient6
%files -n libupsclient7
%{_libdir}/libupsclient.so.*
%files -n libnutconf0
%{_libdir}/libnutconf.so.*
%files cgi
%dir %{apache_serverroot}
%dir %{apache_serverroot}/cgi-bin
@@ -512,12 +529,12 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%config(noreplace) %{CONFPATH}/upsstats.html
%files devel
%{_includedir}/*.h
%{_includedir}/*.{h,hpp}
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_libexecdir}/sockdebug
%{_mandir}/man3/*%{ext_man}
%python_sitearch/test_nutclient.py
%python_sitelib/test_nutclient.py
%files doc-asciidoc
%doc %dir %{_docdir}/%{name}{,/cables}
@@ -525,16 +542,19 @@ udevadm trigger --subsystem-match=usb --property-match=DEVTYPE=usb_device
%{_docdir}/%{name}/cables/*.txt
%files devel-doc-html
%{_docdir}/%{name}/developer-guide.html
%{_docdir}/%{name}/html-doc/developer-guide.html
%{_docdir}/%{name}/html-doc/qa-guide.html
%files doc-html
%{_docdir}/%{name}/ChangeLog.html
%{_docdir}/%{name}/FAQ.html
%{_docdir}/%{name}/cables.html
%{_docdir}/%{name}/release-notes.html
%{_docdir}/%{name}/solaris-usb.html
%{_docdir}/%{name}/user-manual.html
%{_docdir}/%{name}/*.css
%{_docdir}/%{name}/html-man
%dir %{_docdir}/%{name}/html-doc
%{_docdir}/%{name}/html-doc/FAQ.html
%{_docdir}/%{name}/html-doc/cables.html
%{_docdir}/%{name}/html-doc/ChangeLog.html
%{_docdir}/%{name}/html-doc/release-notes.html
%{_docdir}/%{name}/html-doc/solaris-usb.html
%{_docdir}/%{name}/html-doc/user-manual.html
%{_docdir}/%{name}/html-doc/*.css
%files doc-images
%doc %dir %{_docdir}/%{name}

View File

@@ -1,535 +0,0 @@
From 94f6109dfcc34952b00179526b84a6d82eb24e34 Mon Sep 17 00:00:00 2001
From: cgarz <20268068+cgarz@users.noreply.github.com>
Date: Fri, 31 Jan 2025 06:06:00 +0000
Subject: [PATCH 01/16] added replacement read_until and leftover buffer
---
scripts/python/module/PyNUT.py.in | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/scripts/python/module/PyNUT.py.in b/scripts/python/module/PyNUT.py.in
index 6838fc373a..484df8b25a 100644
--- a/scripts/python/module/PyNUT.py.in
+++ b/scripts/python/module/PyNUT.py.in
@@ -84,6 +84,7 @@ class PyNUTClient :
__password = None
__timeout = None
__srv_handler = None
+ __recv_leftover = b''
__version = "1.6.0"
__release = "2023-01-18"
@@ -122,6 +123,19 @@ timeout : Timeout used to wait for network response
except :
pass
+ def __read_until(self, finished_reading_data):
+ data = self.__recv_leftover
+ while (data_end_index := data.find(finished_reading_data)) == -1:
+ data += self.__srv_handler.recv(50) # nut_telnetlib.py uses 50
+ data_end_index += len(finished_reading_data)
+
+ if data_end_index == len(data):
+ self.__recv_leftover = b''
+ else:
+ self.__recv_leftover = data[data_end_index:]
+ data = data[:data_end_index]
+ return data
+
def __connect( self ) :
""" Connects to the defined server
From 60a7ca19a87491be7b58f693977ea5a365290842 Mon Sep 17 00:00:00 2001
From: cgarz <20268068+cgarz@users.noreply.github.com>
Date: Fri, 31 Jan 2025 06:14:33 +0000
Subject: [PATCH 02/16] switch to socket send and replacement read_until
---
scripts/python/module/PyNUT.py.in | 107 ++++++++++++++----------------
1 file changed, 51 insertions(+), 56 deletions(-)
diff --git a/scripts/python/module/PyNUT.py.in b/scripts/python/module/PyNUT.py.in
index 484df8b25a..18f43954ca 100644
--- a/scripts/python/module/PyNUT.py.in
+++ b/scripts/python/module/PyNUT.py.in
@@ -55,8 +55,16 @@
# 2023-01-18 Jim Klimov <jimklimov+nut@gmail.com> - Version 1.6.0
# Added CheckUPSAvailable() method originally by Michal Hlavinka
# from 2013-01-07 RedHat/Fedora packaging
+#
+# 2024-07-01 Jim Klimov <jimklimov+nut@gmail.com> - Version 1.7.0
+# Re-arranged dependency on telnetlib module (deprecated/removed
+# since Python 3.11/3.13), so we can fall back on a privately
+# stashed copy until a better solution is developed.
+#
+# 2025-01-31 cgar <github.com/cgarz> - Version 1.8.0
+# Removed telnetlib dependency. Switched to using socket directly.
-import telnetlib
+import socket
class PyNUTError( Exception ) :
""" Base class for custom exceptions """
@@ -119,7 +113,7 @@ timeout : Timeout used to wait for network response
def __del__( self ) :
""" Class destructor method """
try :
- self.__srv_handler.write( b"LOGOUT\n" )
+ self.__srv_handler.send( b"LOGOUT\n" )
except :
pass
@@ -145,23 +139,24 @@ if something goes wrong.
if self.__debug :
print( "[DEBUG] Connecting to host" )
- self.__srv_handler = telnetlib.Telnet( self.__host, self.__port )
+ self.__srv_handler = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
+ self.__srv_handler.connect( (self.__host, self.__port) )
if self.__login != None :
- self.__srv_handler.write( ("USERNAME %s\n" % self.__login).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n", self.__timeout )
+ self.__srv_handler.send( ("USERNAME %s\n" % self.__login).encode('ascii') )
+ result = self.__read_until( b"\n" )
if result[:2] != b"OK" :
raise PyNUTError( result.replace( b"\n", b"" ).decode('ascii') )
if self.__password != None :
- self.__srv_handler.write( ("PASSWORD %s\n" % self.__password).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n", self.__timeout )
+ self.__srv_handler.send( ("PASSWORD %s\n" % self.__password).encode('ascii') )
+ result = self.__read_until( b"\n" )
if result[:2] != b"OK" :
if result == b"ERR INVALID-ARGUMENT\n" :
# Quote the password (if it has whitespace etc)
# TODO: Escape special chard like NUT does?
- self.__srv_handler.write( ("PASSWORD \"%s\"\n" % self.__password).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n", self.__timeout )
+ self.__srv_handler.send( ("PASSWORD \"%s\"\n" % self.__password).encode('ascii') )
+ result = self.__read_until( b"\n" )
if result[:2] != b"OK" :
raise PyNUTError( result.replace( b"\n", b"" ).decode('ascii') )
else:
@@ -179,12 +174,12 @@ which is of little concern for Python2 but is important in Python3
if self.__debug :
print( "[DEBUG] GetUPSList from server" )
- self.__srv_handler.write( b"LIST UPS\n" )
- result = self.__srv_handler.read_until( b"\n" )
- if result != b"BEGIN LIST UPS\n" :
+ self.__srv_handler.send( b"LIST UPS\n" )
+ result = self.__read_until( b"\n" )
+ if result != b"BEGIN LIST UPS\n":
raise PyNUTError( result.replace( b"\n", b"" ).decode('ascii') )
- result = self.__srv_handler.read_until( b"END LIST UPS\n" )
+ result = self.__read_until( b"END LIST UPS\n" )
ups_list = {}
for line in result.split( b"\n" ) :
@@ -219,13 +214,13 @@ available vars.
if self.__debug :
print( "[DEBUG] GetUPSVars called..." )
- self.__srv_handler.write( ("LIST VAR %s\n" % ups).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( ("LIST VAR %s\n" % ups).encode('ascii') )
+ result = self.__read_until( b"\n" )
if result != ("BEGIN LIST VAR %s\n" % ups).encode('ascii') :
raise PyNUTError( result.replace( b"\n", b"" ).decode('ascii') )
ups_vars = {}
- result = self.__srv_handler.read_until( ("END LIST VAR %s\n" % ups).encode('ascii') )
+ result = self.__read_until( ("END LIST VAR %s\n" % ups).encode('ascii') )
offset = len( ("VAR %s " % ups ).encode('ascii') )
end_offset = 0 - ( len( ("END LIST VAR %s\n" % ups).encode('ascii') ) + 1 )
@@ -245,12 +240,12 @@ The result is True (reachable) or False (unreachable)
if self.__debug :
print( "[DEBUG] CheckUPSAvailable called..." )
- self.__srv_handler.write( ("LIST CMD %s\n" % ups).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( ("LIST CMD %s\n" % ups).encode('ascii') )
+ result = self.__read_until( b"\n" )
if result != ("BEGIN LIST CMD %s\n" % ups).encode('ascii') :
return False
- self.__srv_handler.read_until( ("END LIST CMD %s\n" % ups).encode('ascii') )
+ self.__read_until( ("END LIST CMD %s\n" % ups).encode('ascii') )
return True
def GetUPSCommands( self, ups="" ) :
@@ -262,13 +257,13 @@ of the command as value
if self.__debug :
print( "[DEBUG] GetUPSCommands called..." )
- self.__srv_handler.write( ("LIST CMD %s\n" % ups).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( ("LIST CMD %s\n" % ups).encode('ascii') )
+ result = self.__read_until( b"\n" )
if result != ("BEGIN LIST CMD %s\n" % ups).encode('ascii') :
raise PyNUTError( result.replace( b"\n", b"" ).decode('ascii') )
ups_cmds = {}
- result = self.__srv_handler.read_until( ("END LIST CMD %s\n" % ups).encode('ascii') )
+ result = self.__read_until( ("END LIST CMD %s\n" % ups).encode('ascii') )
offset = len( ("CMD %s " % ups).encode('ascii') )
end_offset = 0 - ( len( ("END LIST CMD %s\n" % ups).encode('ascii') ) + 1 )
@@ -277,8 +272,8 @@ of the command as value
# For each var we try to get the available description
try :
- self.__srv_handler.write( ("GET CMDDESC %s %s\n" % ( ups, var )).encode('ascii') )
- temp = self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( ("GET CMDDESC %s %s\n" % ( ups, var )).encode('ascii') )
+ temp = self.__read_until( b"\n" )
if temp[:7] != b"CMDDESC" :
raise PyNUTError
else :
@@ -299,12 +294,12 @@ The result is presented as a dictionary containing 'key->val' pairs
if self.__debug :
print( "[DEBUG] GetUPSVars from '%s'..." % ups )
- self.__srv_handler.write( ("LIST RW %s\n" % ups).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( ("LIST RW %s\n" % ups).encode('ascii') )
+ result = self.__read_until( b"\n" )
if ( result != ("BEGIN LIST RW %s\n" % ups).encode('ascii') ) :
raise PyNUTError( result.replace( b"\n", b"" ).decode('ascii') )
- result = self.__srv_handler.read_until( ("END LIST RW %s\n" % ups).encode('ascii') )
+ result = self.__read_until( ("END LIST RW %s\n" % ups).encode('ascii') )
offset = len( ("VAR %s" % ups).encode('ascii') )
end_offset = 0 - ( len( ("END LIST RW %s\n" % ups).encode('ascii') ) + 1 )
rw_vars = {}
@@ -327,8 +322,8 @@ The variable must be a writable value (cf GetRWVars) and you must have the prope
rights to set it (maybe login/password).
"""
- self.__srv_handler.write( ("SET VAR %s %s %s\n" % ( ups, var, value )).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( ("SET VAR %s %s %s\n" % ( ups, var, value )).encode('ascii') )
+ result = self.__read_until( b"\n" )
if ( result == b"OK\n" ) :
return( "OK" )
else :
@@ -343,8 +338,8 @@ Returns OK on success or raises an error
if self.__debug :
print( "[DEBUG] RunUPSCommand called..." )
- self.__srv_handler.write( ("INSTCMD %s %s\n" % ( ups, command )).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( ("INSTCMD %s %s\n" % ( ups, command )).encode('ascii') )
+ result = self.__read_until( b"\n" )
if ( result == b"OK\n" ) :
return( "OK" )
else :
@@ -369,12 +364,12 @@ of connection.
print( "[DEBUG] DeviceLogin: %s is not a valid UPS" % ups )
raise PyNUTError( "ERR UNKNOWN-UPS" )
- self.__srv_handler.write( ("LOGIN %s\n" % ups).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( ("LOGIN %s\n" % ups).encode('ascii') )
+ result = self.__read_until( b"\n" )
if ( result.startswith( ("User %s@" % self.__login).encode('ascii')) and result.endswith (("[%s]\n" % ups).encode('ascii')) ):
# User dummy-user@127.0.0.1 logged into UPS [dummy]
# Read next line then
- result = self.__srv_handler.read_until( b"\n" )
+ result = self.__read_until( b"\n" )
if ( result == b"OK\n" ) :
return( "OK" )
else :
@@ -392,13 +387,13 @@ NOTE: API changed since NUT 2.8.0 to replace MASTER with PRIMARY
if self.__debug :
print( "[DEBUG] PRIMARY called..." )
- self.__srv_handler.write( ("PRIMARY %s\n" % ups).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( ("PRIMARY %s\n" % ups).encode('ascii') )
+ result = self.__read_until( b"\n" )
if ( result != b"OK PRIMARY-GRANTED\n" ) :
if self.__debug :
print( "[DEBUG] Retrying: MASTER called..." )
- self.__srv_handler.write( ("MASTER %s\n" % ups).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( ("MASTER %s\n" % ups).encode('ascii') )
+ result = self.__read_until( b"\n" )
if ( result != b"OK MASTER-GRANTED\n" ) :
if self.__debug :
print( "[DEBUG] Primary level functions are not available" )
@@ -406,8 +401,8 @@ NOTE: API changed since NUT 2.8.0 to replace MASTER with PRIMARY
if self.__debug :
print( "[DEBUG] FSD called..." )
- self.__srv_handler.write( ("FSD %s\n" % ups).encode('ascii') )
- result = self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( ("FSD %s\n" % ups).encode('ascii') )
+ result = self.__read_until( b"\n" )
if ( result == b"OK FSD-SET\n" ) :
return( "OK" )
else :
@@ -420,8 +415,8 @@ NOTE: API changed since NUT 2.8.0 to replace MASTER with PRIMARY
if self.__debug :
print( "[DEBUG] HELP called..." )
- self.__srv_handler.write( b"HELP\n" )
- return self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( b"HELP\n" )
+ return self.__read_until( b"\n" )
def ver(self) :
""" Send VER command
@@ -430,8 +425,8 @@ NOTE: API changed since NUT 2.8.0 to replace MASTER with PRIMARY
if self.__debug :
print( "[DEBUG] VER called..." )
- self.__srv_handler.write( b"VER\n" )
- return self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( b"VER\n" )
+ return self.__read_until( b"\n" )
def ListClients( self, ups = None ) :
""" Returns the list of connected clients from the NUT server
@@ -449,12 +444,12 @@ The result is a dictionary containing 'key->val' pairs of 'UPSName' and a list o
raise PyNUTError( "ERR UNKNOWN-UPS" )
if ups:
- self.__srv_handler.write( ("LIST CLIENT %s\n" % ups).encode('ascii') )
+ self.__srv_handler.send( ("LIST CLIENT %s\n" % ups).encode('ascii') )
else:
# NOTE: Currently NUT does not support just listing all clients
# (not providing an "ups" argument) => NUT_ERR_INVALID_ARGUMENT
- self.__srv_handler.write( b"LIST CLIENT\n" )
- result = self.__srv_handler.read_until( b"\n" )
+ self.__srv_handler.send( b"LIST CLIENT\n" )
+ result = self.__read_until( b"\n" )
if ( (ups and result != ("BEGIN LIST CLIENT %s\n" % ups).encode('ascii')) or (ups is None and result != b"BEGIN LIST CLIENT\n") ):
if ups is None and (result == b"ERR INVALID-ARGUMENT\n") :
# For ups==None, list all upses, list their clients
@@ -472,11 +467,11 @@ The result is a dictionary containing 'key->val' pairs of 'UPSName' and a list o
raise PyNUTError( result.replace( b"\n", b"" ).decode('ascii') )
- if ups :
- result = self.__srv_handler.read_until( ("END LIST CLIENT %s\n" % ups).encode('ascii') )
+ if ups:
+ result = self.__read_until( ("END LIST CLIENT %s\n" % ups).encode('ascii') )
else:
# Should not get here with current NUT:
- result = self.__srv_handler.read_until( b"END LIST CLIENT\n" )
+ result = self.__read_until( b"END LIST CLIENT\n" )
ups_list = {}
for line in result.split( b"\n" ):
From 1209078c62ad4b6138029f59b33dff4008235ad5 Mon Sep 17 00:00:00 2001
From: cgarz <20268068+cgarz@users.noreply.github.com>
Date: Fri, 31 Jan 2025 06:19:16 +0000
Subject: [PATCH 03/16] Switch to socket timeout, fix its init argument
---
scripts/python/module/PyNUT.py.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/python/module/PyNUT.py.in b/scripts/python/module/PyNUT.py.in
index 18f43954ca..66e4b6c0d6 100644
--- a/scripts/python/module/PyNUT.py.in
+++ b/scripts/python/module/PyNUT.py.in
@@ -105,7 +105,7 @@ timeout : Timeout used to wait for network response
self.__port = port
self.__login = login
self.__password = password
- self.__timeout = 5
+ self.__timeout = timeout
self.__connect()
@@ -141,6 +141,7 @@ if something goes wrong.
self.__srv_handler = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
self.__srv_handler.connect( (self.__host, self.__port) )
+ self.__srv_handler.settimeout( self.__timeout )
if self.__login != None :
self.__srv_handler.send( ("USERNAME %s\n" % self.__login).encode('ascii') )
From 7ee628f920bd11dd5565b0e10cbfa6fd54aa23c8 Mon Sep 17 00:00:00 2001
From: cgarz <20268068+cgarz@users.noreply.github.com>
Date: Tue, 4 Feb 2025 22:27:01 +0000
Subject: [PATCH 04/16] Remove walrus op for older python compatibility.
---
scripts/python/module/PyNUT.py.in | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/scripts/python/module/PyNUT.py.in b/scripts/python/module/PyNUT.py.in
index 66e4b6c0d6..ced5231193 100644
--- a/scripts/python/module/PyNUT.py.in
+++ b/scripts/python/module/PyNUT.py.in
@@ -119,8 +119,12 @@ timeout : Timeout used to wait for network response
def __read_until(self, finished_reading_data):
data = self.__recv_leftover
- while (data_end_index := data.find(finished_reading_data)) == -1:
- data += self.__srv_handler.recv(50) # nut_telnetlib.py uses 50
+ while True:
+ data_end_index = data.find(finished_reading_data)
+ if data_end_index == -1:
+ data += self.__srv_handler.recv(50) # nut_telnetlib.py uses 50
+ else:
+ break
data_end_index += len(finished_reading_data)
if data_end_index == len(data):
From 9f81e81af3f8bed3fb1e501b5c0b8f638f28f125 Mon Sep 17 00:00:00 2001
From: cgarz <20268068+cgarz@users.noreply.github.com>
Date: Fri, 7 Feb 2025 08:45:40 +0000
Subject: [PATCH 05/16] Use socket create_connection instead of connect,
Handles choosing IPv4 and IPv6 automatically.
---
scripts/python/module/PyNUT.py.in | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/python/module/PyNUT.py.in b/scripts/python/module/PyNUT.py.in
index ced5231193..b815c4af73 100644
--- a/scripts/python/module/PyNUT.py.in
+++ b/scripts/python/module/PyNUT.py.in
@@ -143,9 +143,10 @@ if something goes wrong.
if self.__debug :
print( "[DEBUG] Connecting to host" )
- self.__srv_handler = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
- self.__srv_handler.connect( (self.__host, self.__port) )
- self.__srv_handler.settimeout( self.__timeout )
+ self.__srv_handler = socket.create_connection(
+ (self.__host, self.__port),
+ self.__timeout
+ )
if self.__login != None :
self.__srv_handler.send( ("USERNAME %s\n" % self.__login).encode('ascii') )
From cf0ea3e447f3d97237ba8575202437a59355bd3a Mon Sep 17 00:00:00 2001
From: cgarz <20268068+cgarz@users.noreply.github.com>
Date: Fri, 7 Feb 2025 08:47:38 +0000
Subject: [PATCH 06/16] Update PyNUT changelog, bump version to 1.8.0
---
scripts/python/module/PyNUT.py.in | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/python/module/PyNUT.py.in b/scripts/python/module/PyNUT.py.in
index b815c4af73..0e136d3669 100644
--- a/scripts/python/module/PyNUT.py.in
+++ b/scripts/python/module/PyNUT.py.in
@@ -74,8 +82,8 @@ class PyNUTClient :
__srv_handler = None
__recv_leftover = b''
- __version = "1.6.0"
- __release = "2023-01-18"
+ __version = "1.8.0"
+ __release = "2025-02-07"
def __init__( self, host="127.0.0.1", port=3493, login=None, password=None, debug=False, timeout=5 ) :
From 0488ec573943468fb0e0570c396b66c2dfcc35d9 Mon Sep 17 00:00:00 2001
From: cgarz <20268068+cgarz@users.noreply.github.com>
Date: Fri, 7 Feb 2025 08:57:21 +0000
Subject: [PATCH 12/16] Update setup.py.in, remove install_requires lib
---
scripts/python/module/setup.py.in | 5 -----
1 file changed, 5 deletions(-)
diff --git a/scripts/python/module/setup.py.in b/scripts/python/module/setup.py.in
index 10ada3ecd6..d520c960f9 100644
--- a/scripts/python/module/setup.py.in
+++ b/scripts/python/module/setup.py.in
@@ -30,7 +30,6 @@ setup(
#data_files = [('', ['tox.ini'])],
#scripts = ['PyNUTClient/test_nutclient.py', 'PyNUTClient/__init__.py'],
python_requires = '>=2.6',
- # install_requires = ['telnetlib'], # NOTE: telnetlib.py is part of Python core for tested 2.x and 3.x versions, not something 'pip' can download
keywords = ['pypi', 'cicd', 'python', 'nut', 'Network UPS Tools'],
classifiers = [
"Development Status :: 5 - Production/Stable",
From 6d671b039e6df10091f6219ed9ae7169bf25c6e5 Mon Sep 17 00:00:00 2001
From: Jim Klimov <jimklimov+nut@gmail.com>
Date: Fri, 7 Feb 2025 12:24:14 +0100
Subject: [PATCH 14/16] configure.ac: restore nut_with_pynut_py* checks from
v2.8.2, but test for "socket" instead of "telnetlib" module [#2183]
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
---
configure.ac | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/configure.ac b/configure.ac
index 07febb3cb8..8d278d8085 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2384,7 +2384,7 @@ if test x"${nut_with_pynut}" != xno \
if test -n "${PYTHON2}" \
&& (command -v ${PYTHON2} || which ${PYTHON2}) >/dev/null 2>/dev/null \
; then
- if ${PYTHON2} -c "import telnetlib" \
+ if ${PYTHON2} -c "import socket" \
; then
nut_with_pynut_py2="yes"
fi
@@ -2393,7 +2393,7 @@ if test x"${nut_with_pynut}" != xno \
if test -n "${PYTHON3}" \
&& (command -v ${PYTHON3} || which ${PYTHON3}) >/dev/null 2>/dev/null \
; then
- if ${PYTHON3} -c "import telnetlib" \
+ if ${PYTHON3} -c "import socket" \
; then
nut_with_pynut_py3="yes"
fi
@@ -2404,7 +2404,7 @@ if test x"${nut_with_pynut}" != xno \
&& (command -v ${PYTHON} || which ${PYTHON}) >/dev/null 2>/dev/null \
&& test "${PYTHON}" != "${PYTHON2}" -a "${PYTHON}" != "${PYTHON3}" \
; then
- if ${PYTHON} -c "import telnetlib" \
+ if ${PYTHON} -c "import socket" \
; then
nut_with_pynut_py="yes"
fi
From c5540c43d28d7bfcae9426b92a44a805d7ac27bd Mon Sep 17 00:00:00 2001
From: Jim Klimov <jimklimov+nut@gmail.com>
Date: Fri, 7 Feb 2025 15:32:34 +0100
Subject: [PATCH 16/16] tests/NIT/nit.sh: update comment about use of two
explicit localhost IPv4/6 addresses, not a name, for upsd.conf
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
---
tests/NIT/nit.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/NIT/nit.sh b/tests/NIT/nit.sh
index befec52803..cf0a98bb7f 100755
--- a/tests/NIT/nit.sh
+++ b/tests/NIT/nit.sh
@@ -363,8 +363,8 @@ EOF
fi
# Some systems listining on symbolic "localhost" actually
- # only bind to IPv6, and Python telnetlib resolves IPv4
- # and fails its connection tests. Others fare well with
+ # only bind to IPv6, and some (Python) client might resolve
+ # IPv4 and fail its connection tests. Others fare well with
# both addresses in one command.
for LH in 127.0.0.1 '::1' ; do
if (