| Server IP : 213.136.93.164 / Your IP : 216.73.216.20 Web Server : Apache System : Linux m14200.contabo.net 5.14.0-611.54.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed May 6 18:03:03 EDT 2026 x86_64 User : ki692510 ( 1047) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib/python3.9/site-packages/up2date_client/ |
Upload File : |
# 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 os
import gettext
import distro
from up2date_client import config
from up2date_client.pkgplatform import getPlatform
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.gettext
def getVersion():
"""
Returns the version of redhat-release rpm
"""
cfg = config.initUp2dateConfig()
if cfg["versionOverride"]:
return str(cfg["versionOverride"])
if getPlatform() == 'deb':
return distro.codename()
return distro.major_version()
def getOSRelease():
"""
Returns the name of the system
"""
if getPlatform() == 'deb':
return 'Ubuntu'
return "CloudLinux"
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 "3.0.3-2.el9.cloudlinux"