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