|
From: <ba...@us...> - 2009-03-18 20:30:01
|
Revision: 1168
http://omc.svn.sourceforge.net/omc/?rev=1168&view=rev
Author: bartw
Date: 2009-03-18 20:29:45 +0000 (Wed, 18 Mar 2009)
Log Message:
-----------
some fixes for redhat
Modified Paths:
--------------
pybase/trunk/OMC_InitdService.py
pybase/trunk/OMC_OperatingSystem.py
Modified: pybase/trunk/OMC_InitdService.py
===================================================================
--- pybase/trunk/OMC_InitdService.py 2009-03-06 21:14:14 UTC (rev 1167)
+++ pybase/trunk/OMC_InitdService.py 2009-03-18 20:29:45 UTC (rev 1168)
@@ -47,6 +47,7 @@
if file in ('reboot',
'halt',
+ 'killall',
'single',
'README',
'core',
Modified: pybase/trunk/OMC_OperatingSystem.py
===================================================================
--- pybase/trunk/OMC_OperatingSystem.py 2009-03-06 21:14:14 UTC (rev 1167)
+++ pybase/trunk/OMC_OperatingSystem.py 2009-03-18 20:29:45 UTC (rev 1168)
@@ -102,19 +102,23 @@
model.update(LastBootUpTime = pywbem.CIMDateTime.fromtimestamp(
time.time() - float(fo.read().split()[0])))
fo.close()
+ infofile = None
if os.path.exists('/etc/SuSE-release'):
- fo = open('/etc/SuSE-release', 'r')
+ infofile = '/etc/SuSE-release'
+ elif os.path.exists('/etc/redhat-release'):
+ infofile = '/etc/redhat-release'
+ if infofile is not None:
+ fo = open(infofile, 'r')
version = fo.readline().strip()
model.update(Version = version)
model.update(ElementName = version)
model.update(Description = version)
model.update(Caption = version)
fo.close()
- install_time = Popen(['/bin/rpm', '-qf','/etc/SuSE-release',
+ install_time = Popen(['/bin/rpm', '-qf', infofile,
'--queryformat','%{INSTALLTIME}'],
stdout=PIPE).communicate()[0]
model.update(InstallDate = pywbem.CIMDateTime.fromtimestamp(int(install_time)))
- # TODO non-SUSE distros
model.update(Distributed = True)
#model['EnabledDefault'] = # TODO (type = pywbem.Uint16 self.Values.EnabledDefault) (default=2L)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|