summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mic/utils/misc.py12
-rwxr-xr-xtools/mic2
2 files changed, 10 insertions, 4 deletions
diff --git a/mic/utils/misc.py b/mic/utils/misc.py
index 9db2eaf..d90041d 100644
--- a/mic/utils/misc.py
+++ b/mic/utils/misc.py
@@ -114,15 +114,21 @@ def get_distro():
return (dist, ver, id)
-def get_distro_str():
+def get_hostname():
+ """Get hostname
+ """
+ return platform.node()
+
+def get_hostname_distro_str():
"""Get composited string for current linux distribution
"""
(dist, ver, id) = get_distro()
+ hostname = get_hostname()
if not dist:
- return 'Unknown Linux Distro'
+ return "%s(Unknown Linux Distribution)" % hostname
else:
- distro_str = ' '.join(map(str.strip, (dist, ver, id)))
+ distro_str = ' '.join(map(str.strip, (hostname, dist, ver, id)))
return distro_str.strip()
_LOOP_RULE_PTH = None
diff --git a/tools/mic b/tools/mic
index 6a0afa1..a81a905 100755
--- a/tools/mic
+++ b/tools/mic
@@ -48,7 +48,7 @@ class MicCmd(cmdln.Cmdln):
def print_version(self):
msger.raw("%s %s (%s)" % (self.name,
self.version,
- misc.get_distro_str()))
+ misc.get_hostname_distro_str()))
def get_optparser(self):
optparser = cmdln.CmdlnOptionParser(self, version=self.version)