diff options
author | Pavel Moravec <pmoravec@redhat.com> | 2019-07-09 13:04:07 +0200 |
---|---|---|
committer | Pavel Moravec <pmoravec@redhat.com> | 2019-07-09 13:04:07 +0200 |
commit | fb6363c004e15cb6d37c7db687d776382bf205e9 (patch) | |
tree | 082755764658ad4c2d753e4bbbcc9ae261cbf597 | |
parent | fc41da43106ba3d779a19cc910a2f430faf4a030 (diff) | |
download | sos-fb6363c004e15cb6d37c7db687d776382bf205e9.tar.gz |
[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 <pmoravec@redhat.com>
-rw-r--r-- | sos/policies/redhat.py | 23 |
1 files changed, 0 insertions, 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: |