From 4aa7e6e383fd9a36931b1125a8e8cd8e3ebcf1de Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Thu, 13 Jun 2019 16:39:54 +0200 Subject: [PATCH] [policies] redhat policy to use hostname instead of rhn id for local name 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 28d48d2d8..5fa1695c5 100644 --- a/sos/policies/redhat.py +++ b/sos/policies/redhat.py @@ -19,14 +19,6 @@ 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 @@ def get_tmp_dir(self, opt_tmp_dir): 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 @@ def dist_version(self): 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: