refactor(deps): remove obsolete dependencies and support modern Ubuntu
ogagent/pipeline/head There was a failure building this commit
Details
ogagent/pipeline/head There was a failure building this commit
Details
parent
9ffa27cd03
commit
0db7dbce9f
|
|
@ -1,3 +1,10 @@
|
|||
ogagent (8.5.5-1) stable; urgency=medium
|
||||
|
||||
* Remove obsolete dependencies (six, prctl, libxss1) to support modern Ubuntu releases (like 26.04)
|
||||
* Update policykit-1 to polkitd
|
||||
|
||||
-- OpenGnsys developers <info@opengnsys.es> Thu, 09 Jul 2026 12:00:00 +0200
|
||||
|
||||
ogagent (8.5.4-1) stable; urgency=medium
|
||||
|
||||
* Fix network detection race condition on slow-booting machines: activation
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Section: admin
|
|||
Priority: optional
|
||||
Architecture: all
|
||||
Depends:
|
||||
policykit-1 (>= 0.100), python3 (>=3.4) | python (>= 3.4), python3-pyqt6, python3-requests,
|
||||
python3-six, python3-prctl, python3-distro, libxss1, zenity, ${misc:Depends}
|
||||
polkitd | policykit-1 (>= 0.100), python3 (>=3.4), python3-pyqt6, python3-requests,
|
||||
python3-distro, zenity, ${misc:Depends}
|
||||
Description: OpenGnsys Agent for Operating Systems
|
||||
This package provides the required components to allow this machine to work on an environment managed by OpenGnsys.
|
||||
|
|
|
|||
|
|
@ -31,9 +31,6 @@
|
|||
"""
|
||||
|
||||
|
||||
# On centos, old six release does not includes byte2int, nor six.PY2
|
||||
import six
|
||||
|
||||
from . import modules
|
||||
from .RESTApi import REST, RESTError
|
||||
|
||||
|
|
@ -46,11 +43,4 @@ __author__ = 'Adolfo Gómez'
|
|||
__license__ = "BSD 3-clause"
|
||||
__copyright__ = "Copyright VirtualCable S.L.U."
|
||||
|
||||
if not hasattr(six, 'byte2int'):
|
||||
if six.PY3:
|
||||
import operator
|
||||
six.byte2int = operator.itemgetter(0)
|
||||
else:
|
||||
def _byte2int(bs):
|
||||
return ord(bs[0])
|
||||
six.byte2int = _byte2int
|
||||
|
||||
|
|
|
|||
|
|
@ -34,10 +34,9 @@ import os
|
|||
import json
|
||||
import ssl
|
||||
import threading
|
||||
from six.moves.socketserver import ThreadingMixIn # @UnresolvedImport
|
||||
from six.moves.BaseHTTPServer import BaseHTTPRequestHandler # @UnresolvedImport
|
||||
from six.moves.BaseHTTPServer import HTTPServer # @UnresolvedImport
|
||||
from six.moves.urllib.parse import unquote # @UnresolvedImport
|
||||
from socketserver import ThreadingMixIn
|
||||
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||
from urllib.parse import unquote
|
||||
|
||||
from .utils import exceptionToMessage
|
||||
from .certs import createSelfSignedCert
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ import ctypes.util
|
|||
import subprocess
|
||||
import struct
|
||||
import array
|
||||
import six
|
||||
import distro
|
||||
from opengnsys import utils
|
||||
|
||||
|
|
@ -53,12 +52,12 @@ def _getMacAddr(ifname):
|
|||
'''
|
||||
if isinstance(ifname, list):
|
||||
return dict([(name, _getMacAddr(name)) for name in ifname])
|
||||
if isinstance(ifname, six.text_type):
|
||||
if isinstance(ifname, str):
|
||||
ifname = ifname.encode('utf-8') # If unicode, convert to bytes (or str in python 2.7)
|
||||
try:
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
info = bytearray(fcntl.ioctl(s.fileno(), 0x8927, struct.pack(str('256s'), ifname[:15])))
|
||||
return six.text_type(''.join(['%02x:' % char for char in info[18:24]])[:-1])
|
||||
return str(''.join(['%02x:' % char for char in info[18:24]])[:-1])
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
|
|
@ -70,11 +69,11 @@ def _getIpAddr(ifname):
|
|||
'''
|
||||
if isinstance(ifname, list):
|
||||
return dict([(name, _getIpAddr(name)) for name in ifname])
|
||||
if isinstance(ifname, six.text_type):
|
||||
if isinstance(ifname, str):
|
||||
ifname = ifname.encode('utf-8') # If unicode, convert to bytes (or str in python 2.7)
|
||||
try:
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
return six.text_type(socket.inet_ntoa(fcntl.ioctl(
|
||||
return str(socket.inet_ntoa(fcntl.ioctl(
|
||||
s.fileno(),
|
||||
0x8915, # SIOCGIFADDR
|
||||
struct.pack(str('256s'), ifname[:15])
|
||||
|
|
@ -138,11 +137,6 @@ def reboot(flags=0):
|
|||
'''
|
||||
Simple reboot using os command
|
||||
'''
|
||||
# Workaround for dummy thread
|
||||
if six.PY3 is False:
|
||||
import threading
|
||||
threading._DummyThread._Thread__stop = lambda x: 42
|
||||
|
||||
# Check for OpenGnsys Client or GNU/Linux distribution.
|
||||
if os.path.exists('/scripts/oginit'):
|
||||
subprocess.call('source /opt/opengnsys/etc/preinit/loadenviron.sh; /opt/opengnsys/scripts/reboot', shell=True)
|
||||
|
|
@ -154,11 +148,6 @@ def poweroff(flags=0):
|
|||
'''
|
||||
Simple poweroff using os command
|
||||
'''
|
||||
# Workaround for dummy thread
|
||||
if six.PY3 is False:
|
||||
import threading
|
||||
threading._DummyThread._Thread__stop = lambda x: 42
|
||||
|
||||
# Check for OpenGnsys Client or GNU/Linux distribution.
|
||||
if os.path.exists('/scripts/oginit'):
|
||||
subprocess.call('source /opt/opengnsys/etc/preinit/loadenviron.sh; /opt/opengnsys/scripts/poweroff', shell=True)
|
||||
|
|
@ -171,11 +160,6 @@ def logoff():
|
|||
Kills all curent user processes, which must send a logogof
|
||||
caveat: If the user has other sessions, will also disconnect from them
|
||||
'''
|
||||
# Workaround for dummy thread
|
||||
if six.PY3 is False:
|
||||
import threading
|
||||
threading._DummyThread._Thread__stop = lambda x: 42
|
||||
|
||||
subprocess.call(['/usr/bin/pkill', '-u', os.environ['USER']])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ import ctypes.util
|
|||
import subprocess
|
||||
import struct
|
||||
import array
|
||||
import six
|
||||
import json
|
||||
from opengnsys import utils
|
||||
|
||||
|
|
@ -134,11 +133,6 @@ def reboot(flags=0):
|
|||
'''
|
||||
Simple reboot command
|
||||
'''
|
||||
# Workaround for dummy thread
|
||||
if six.PY3 is False:
|
||||
import threading
|
||||
threading._DummyThread._Thread__stop = lambda x: 42
|
||||
|
||||
# Exec reboot command
|
||||
subprocess.call('/sbin/shutdown -r now', shell=True)
|
||||
|
||||
|
|
@ -147,11 +141,6 @@ def poweroff(flags=0):
|
|||
'''
|
||||
Simple poweroff command
|
||||
'''
|
||||
# Workaround for dummy thread
|
||||
if six.PY3 is False:
|
||||
import threading
|
||||
threading._DummyThread._Thread__stop = lambda x: 42
|
||||
|
||||
# Exec shutdown command
|
||||
subprocess.call('/sbin/shutdown -h now', shell=True)
|
||||
|
||||
|
|
@ -160,11 +149,6 @@ def logoff():
|
|||
'''
|
||||
Simple logout using AppleScript
|
||||
'''
|
||||
# Workaround for dummy thread
|
||||
if six.PY3 is False:
|
||||
import threading
|
||||
threading._DummyThread._Thread__stop = lambda x: 42
|
||||
|
||||
# Exec logout using AppleScript
|
||||
subprocess.call('/usr/bin/osascript -e \'tell app "System Events" to «event aevtrlgo»\'', shell=True)
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
|
||||
import sys
|
||||
import six
|
||||
|
||||
if sys.platform == 'win32':
|
||||
_fromEncoding = 'windows-1250'
|
||||
|
|
@ -42,15 +41,15 @@ else:
|
|||
|
||||
def toUnicode(msg):
|
||||
try:
|
||||
if not isinstance(msg, six.text_type):
|
||||
if isinstance(msg, six.binary_type):
|
||||
if not isinstance(msg, str):
|
||||
if isinstance(msg, bytes):
|
||||
return msg.decode(_fromEncoding, 'ignore')
|
||||
return six.text_type(msg)
|
||||
return str(msg)
|
||||
else:
|
||||
return msg
|
||||
except Exception:
|
||||
try:
|
||||
return six.text_type(msg)
|
||||
return str(msg)
|
||||
except Exception:
|
||||
return ''
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
pywin32
|
||||
pyqt6
|
||||
requests
|
||||
six
|
||||
|
||||
pycryptodome
|
||||
pyinstaller
|
||||
|
|
|
|||
Loading…
Reference in New Issue