|
From: <ba...@us...> - 2008-09-29 17:19:39
|
Revision: 1051
http://omc.svn.sourceforge.net/omc/?rev=1051&view=rev
Author: bartw
Date: 2008-09-29 17:19:29 +0000 (Mon, 29 Sep 2008)
Log Message:
-----------
added description and caption properties to initdservices.
Modified Paths:
--------------
pybase/trunk/OMC_InitdService.py
Modified: pybase/trunk/OMC_InitdService.py
===================================================================
--- pybase/trunk/OMC_InitdService.py 2008-09-29 14:19:11 UTC (rev 1050)
+++ pybase/trunk/OMC_InitdService.py 2008-09-29 17:19:29 UTC (rev 1051)
@@ -99,8 +99,6 @@
logger.log_debug('Entering %s.get_instance() for %s' \
% (self.__class__.__name__, model['name']))
- #model['Caption'] = # TODO (type = unicode)
- #model['Description'] = # TODO (type = unicode)
#model['ElementName'] = # TODO (type = unicode)
#model['EnabledDefault'] = # TODO (type = pywbem.Uint16 self.Values.EnabledDefault) (default=2L)
#model['EnabledState'] = # TODO (type = pywbem.Uint16 self.Values.EnabledState) (default=5L)
@@ -110,6 +108,17 @@
if not filtered and (_blacklist(model['name']) or
not os.path.isfile(fullpath)):
raise pywbem.CIMError(CIM_ERR_NOT_FOUND)
+
+ fo = open(fullpath, 'r')
+ caption = None
+ for line in fo.xreadlines():
+ if line.startswith('#') and 'Short-Description:' in line:
+ caption = line[line.find(':')+1:]
+ break
+ if caption:
+ model['Caption'] = caption
+ model['Description'] = caption
+
osts = []
cmd = fullpath + ' status'
st = call(cmd, shell=True)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|