Change in vdsm[master]: vdsm: added decorator to host uuid function

irit.goihman at gmail.com irit.goihman at gmail.com
Mon Feb 15 13:12:28 UTC 2016


Irit Goihman has uploaded a new change for review.

Change subject: vdsm: added decorator to host uuid function
......................................................................

vdsm: added decorator to host uuid function

Change-Id: I8843d0157ddbaf2f35f582441821af3429b3f8b1
Signed-off-by: Irit Goihman <irit.goihman at gmail.com>
---
M lib/vdsm/host.py
1 file changed, 6 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/53525/1

diff --git a/lib/vdsm/host.py b/lib/vdsm/host.py
index 6ac86d4..e7f7b86 100644
--- a/lib/vdsm/host.py
+++ b/lib/vdsm/host.py
@@ -19,10 +19,10 @@
 #
 from __future__ import absolute_import
 
-from vdsm.utils import memoized
 
 import os
 import logging
+from vdsm.utils import memoized
 from .commands import execCmd
 from . import constants
 from . import cpuarch
@@ -30,16 +30,15 @@
 
 @memoized
 def uuid(legacy=False):
-    __hostUUID = None
+    host_UUID = None
 
     if legacy:
         raise NotImplementedError
 
-
     try:
         if os.path.exists(constants.P_VDSM_NODE_ID):
             with open(constants.P_VDSM_NODE_ID) as f:
-                __hostUUID = f.readline().replace("\n", "")
+                host_UUID = f.readline().replace("\n", "")
         else:
             arch = cpuarch.real()
             if cpuarch.is_x86(arch):
@@ -53,7 +52,7 @@
 
                 if ret == 0 and 'Not' not in out:
                     # Avoid error string - 'Not Settable' or 'Not Present'
-                    __hostUUID = out.strip()
+                    host_UUID = out.strip()
                 else:
                     logging.warning('Could not find host UUID.')
             elif cpuarch.is_ppc(arch):
@@ -61,11 +60,11 @@
                 try:
                     with open('/proc/device-tree/system-id') as f:
                         systemId = f.readline()
-                        __hostUUID = systemId.rstrip('\0').replace(',', '')
+                        host_UUID = systemId.rstrip('\0').replace(',', '')
                 except IOError:
                     logging.warning('Could not find host UUID.')
 
     except:
         logging.error("Error retrieving host UUID", exc_info=True)
 
-    return __hostUUID
+    return host_UUID


-- 
To view, visit https://gerrit.ovirt.org/53525
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8843d0157ddbaf2f35f582441821af3429b3f8b1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <irit.goihman at gmail.com>


More information about the vdsm-patches mailing list