From 11f6a626654c31bd50e390b55d7c0330b6332abb Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Thu, 16 Dec 2010 18:06:03 +0300 Subject: [PATCH] Add hr_cdrom_set variable. --- pym/cl_fill.py | 10 ++++++++++ pym/cl_vars.py | 3 +++ 2 files changed, 13 insertions(+) diff --git a/pym/cl_fill.py b/pym/cl_fill.py index 08b61ab..7d8d07d 100644 --- a/pym/cl_fill.py +++ b/pym/cl_fill.py @@ -279,6 +279,16 @@ class fillVars(varsShare): else: return "" + def get_hr_cdrom_set(self): + """Cdrom variable""" + if os.path.exists('/sys/block/sr0'): + textLines = self._runos("udevadm info --query=all --name=/dev/dvdrw") + if not textLines is False: + for line in textLines: + if "ID_CDROM=1" in line: + return "on" + return "off" + def get_hr_virtual(self): """Virtual machine name (virtualbox, vmware, qemu)""" pciLines = self._runos("/usr/sbin/lspci") diff --git a/pym/cl_vars.py b/pym/cl_vars.py index 66e79e1..eeef153 100644 --- a/pym/cl_vars.py +++ b/pym/cl_vars.py @@ -109,6 +109,9 @@ class Data: # motherboard vendor hr_board_vendor = {'hide':True} + # cdrom device + hr_cdrom_set = {} + # processors count hr_cpu_num = {'hide':True}