Current Path: > > lib > > python3.6 > site-packages > up2date_client
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
__pycache__ | Directory | - | - | |
__init__.py | File | 0 bytes | May 29 2025 13:37:22. | |
capabilities.py | File | 7452 bytes | May 29 2025 13:37:22. | |
clientCaps.py | File | 2208 bytes | May 29 2025 13:37:22. | |
clpwd.py | File | 3643 bytes | May 29 2025 13:37:22. | |
config.py | File | 14803 bytes | May 29 2025 13:37:22. | |
debUtils.py | File | 2830 bytes | May 29 2025 13:37:22. | |
getMethod.py | File | 4302 bytes | May 29 2025 13:37:22. | |
haltree.py | File | 4642 bytes | May 29 2025 13:37:22. | |
hardware.py | File | 32675 bytes | May 29 2025 13:37:22. | |
hardware_gudev.py | File | 13216 bytes | May 29 2025 13:37:22. | |
hardware_hal.py | File | 11604 bytes | May 29 2025 13:37:22. | |
hardware_udev.py | File | 13300 bytes | May 29 2025 13:37:22. | |
pkgUtils.py | File | 295 bytes | May 29 2025 13:37:22. | |
pkgplatform.py | File | 309 bytes | May 29 2025 13:47:19. | |
pmPlugin.py | File | 2859 bytes | May 29 2025 13:37:22. | |
rhnChannel.py | File | 5031 bytes | May 29 2025 13:37:22. | |
rhnHardware.py | File | 328 bytes | May 29 2025 13:37:22. | |
rhnPackageInfo.py | File | 2396 bytes | May 29 2025 13:37:22. | |
rhncli.py | File | 9335 bytes | May 29 2025 13:37:22. | |
rhnreg.py | File | 32101 bytes | May 29 2025 13:37:22. | |
rhnreg_constants.py | File | 18569 bytes | May 29 2025 13:37:22. | |
rhnserver.py | File | 9531 bytes | May 29 2025 13:37:22. | |
rpcServer.py | File | 11999 bytes | May 29 2025 13:37:22. | |
rpmUtils.py | File | 5321 bytes | May 29 2025 13:37:22. | |
transaction.py | File | 4193 bytes | May 29 2025 13:37:22. | |
tui.py | File | 44749 bytes | May 29 2025 13:37:22. | |
up2dateAuth.py | File | 10944 bytes | May 29 2025 13:37:22. | |
up2dateErrors.py | File | 10502 bytes | May 29 2025 13:37:22. | |
up2dateLog.py | File | 2108 bytes | May 29 2025 13:37:22. | |
up2dateUtils.py | File | 5180 bytes | May 29 2025 13:47:19. |
# Client code for Update Agent # Copyright (c) 1999--2018 Red Hat, Inc. Distributed under GPLv2. # # Author: Preston Brown <pbrown@redhat.com> # Adrian Likins <alikins@redhat.com> # """utility functions for up2date""" import contextlib import os import sys import re import gettext from up2date_client import up2dateErrors from up2date_client import config from up2date_client.pkgplatform import getPlatform from rhn.i18n import sstr t = gettext.translation('rhn-client-tools', fallback=True) # Python 3 translations don't have a ugettext method if not hasattr(t, 'ugettext'): t.ugettext = t.gettext _ = t.ugettext if getPlatform() == 'deb': import lsb_release def _getOSVersionAndRelease(): dist_info = lsb_release.get_distro_information() os_name = dist_info['ID'] os_version = 'n/a' if 'CODENAME' in dist_info: os_version = dist_info['CODENAME'] os_release = dist_info['RELEASE'] return os_name, os_version, os_release else: from up2date_client import transaction def _getOSVersionAndRelease(): ts = transaction.initReadOnlyTransaction() for h in ts.dbMatch('Providename', "oraclelinux-release"): SYSRELVER = 'system-release(releasever)' version = sstr(h['version']) release = sstr(h['release']) if SYSRELVER in (sstr(provide) for provide in h['providename']): provides = dict((sstr(n), sstr(v)) for n,v in zip(h['providename'], h['provideversion'])) release = '%s-%s' % (version, release) version = provides[SYSRELVER] osVersionRelease = (sstr(h['name']), version, release) return osVersionRelease else: for h in ts.dbMatch('Providename', "redhat-release"): SYSRELVER = 'system-release(releasever)' version = sstr(h['version']) release = sstr(h['release']) if SYSRELVER in (sstr(provide) for provide in h['providename']): provides = dict((sstr(n), sstr(v)) for n,v in zip(h['providename'], h['provideversion'])) release = '%s-%s' % (version, release) version = provides[SYSRELVER] osVersionRelease = (sstr(h['name']), version, release) return osVersionRelease else: for h in ts.dbMatch('Providename', "distribution-release"): osVersionRelease = (sstr(h['name']), sstr(h['version']), sstr(h['release'])) # zypper requires a exclusive lock on the rpmdb. So we need # to close it here. ts.ts.closeDB() return osVersionRelease else: raise up2dateErrors.RpmError( "Could not determine what version of CloudLinux you "\ "are running.\nIf you get this error, try running \n\n"\ "\t\trpm --rebuilddb\n\n") def getVersion(): ''' Returns the version of redhat-release rpm ''' cfg = config.initUp2dateConfig() if cfg["versionOverride"]: return str(cfg["versionOverride"]) os_release, version, release = _getOSVersionAndRelease() return version def getOSRelease(): ''' Returns the name of the redhat-release rpm ''' os_release, version, release = _getOSVersionAndRelease() return os_release def getRelease(): ''' Returns the release of the redhat-release rpm ''' os_release, version, release = _getOSVersionAndRelease() return release def getArch(): if os.access("/etc/rpm/platform", os.R_OK): fd = open("/etc/rpm/platform", "r") platform = fd.read().strip() #bz 216225 #handle some replacements.. replace = {"ia32e-redhat-linux": "x86_64-redhat-linux"} if platform in replace: platform = replace[platform] return platform arch = os.uname()[4] if getPlatform() == 'deb': # On debian we only support i386 if arch in ['i486', 'i586', 'i686']: arch = 'i386' if arch == 'x86_64': arch = 'amd64' arch += '-debian-linux' return arch def version(): # substituted to the real version by the Makefile at installation time. return "2.12.5-1.module_el8.10.0+6935+f9aadf00.cloudlinux" @contextlib.contextmanager def suppress_errors(error_patterns): ''' Context manager to suppress errors matching the specified patterns ''' read_end, write_end = os.pipe() old_stdout = os.dup(1) old_stderr = os.dup(2) os.dup2(write_end, 1) os.dup2(write_end, 2) try: yield finally: # Restore stdout and stderr os.dup2(old_stdout, 1) os.dup2(old_stderr, 2) os.close(write_end) with os.fdopen(read_end) as f: combined_pattern = re.compile('|'.join(error_patterns)) for line in f: if not combined_pattern.search(line): print(line, file=sys.stderr)
SILENT KILLER Tool