From 237aa8dfaf2cef7fcfc4fbb8cc8fecac6ebcbf1c Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Tue, 14 Sep 2010 15:33:55 +0000 Subject: [PATCH] Added new variable cl_kernel_uid. Variable has value of 8 char of UUID root device. --- pym/cl_fill.py | 15 +++++++++++++++ pym/cl_vars.py | 2 ++ 2 files changed, 17 insertions(+) diff --git a/pym/cl_fill.py b/pym/cl_fill.py index 76c6d11..590ac2f 100644 --- a/pym/cl_fill.py +++ b/pym/cl_fill.py @@ -885,3 +885,18 @@ class fillVars(glob_attr): return "vmware" else: return "vesa" + + def get_cl_kernel_uid(self): + uuidpath = '/dev/disk/by-uuid' + if not os.access(uuidpath,os.R_OK): + return "" + uuidDevs = filter(os.path.islink,map(lambda x: os.path.join(uuidpath,x), + os.listdir(uuidpath))) + mapDevUuid = dict(map(lambda x:(os.path.normpath(os.path.join(uuidpath, + os.readlink(x))), + os.path.basename(x)), + uuidDevs)) + if self.Get('os_root_dev') in mapDevUuid: + return mapDevUuid[self.Get('os_root_dev')][:8] + else: + return "" diff --git a/pym/cl_vars.py b/pym/cl_vars.py index 3859baf..d173659 100644 --- a/pym/cl_vars.py +++ b/pym/cl_vars.py @@ -147,6 +147,8 @@ class Data: # user email ur_mail = {'official':True} + # kernel uid get by uuid root device + cl_kernel_uid = {} # variable for calculate-client and calculate-desktop packages # ip or domain name of CDS cl_remote_host = {'mode':'r', 'official':True}