From fb6363c004e15cb6d37c7db687d776382bf205e9 Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Tue, 9 Jul 2019 13:04:07 +0200 Subject: [policies] redhat policy to use hostname instead of rhn id As rhn is getting obsoleted and each host has its hostname, even redhat policy should use host name as the local name. Resolves: #1702 Signed-off-by: Pavel Moravec --- sos/policies/redhat.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py index 28d48d2d..5fa1695c 100644 --- a/sos/policies/redhat.py +++ b/sos/policies/redhat.py @@ -19,14 +19,6 @@ from sos.policies import LinuxPolicy, PackageManager, PresetDefaults from sos import _sos as _ from sos import SoSOptions -sys.path.insert(0, "/usr/share/rhn/") -try: - from up2date_client import up2dateAuth - from rhn import rpclib -except ImportError: - # might fail if non-RHEL - pass - OS_RELEASE = "/etc/os-release" @@ -174,9 +166,6 @@ class RedHatPolicy(LinuxPolicy): return self._tmp_dir return opt_tmp_dir - def get_local_name(self): - return self.host_name() - # Container environment variables on Red Hat systems. ENV_CONTAINER = 'container' @@ -305,18 +294,6 @@ support representative. pass return False - def rhn_username(self): - try: - rhn_username = rpclib.xmlrpclib.loads( - up2dateAuth.getSystemId())[0][0]['username'] - return rhn_username.encode('utf-8', 'ignore') - except Exception: - # ignore any exception and return an empty username - return "" - - def get_local_name(self): - return self.rhn_username() or self.host_name() - def probe_preset(self): # Package based checks if self.pkg_by_name("satellite-common") is not None: -- cgit