You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(26) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(5) |
Feb
(16) |
Mar
(5) |
Apr
(5) |
May
(13) |
Jun
(12) |
Jul
(1) |
Aug
(2) |
Sep
(13) |
Oct
(6) |
Nov
(1) |
Dec
(29) |
| 2008 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
(57) |
May
(35) |
Jun
(45) |
Jul
(132) |
Aug
(87) |
Sep
(141) |
Oct
(86) |
Nov
(17) |
Dec
(2) |
| 2009 |
Jan
(3) |
Feb
(2) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
(1) |
2
|
3
|
4
|
5
|
6
|
7
|
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
|
15
|
16
|
17
|
18
|
19
|
20
|
21
|
|
22
|
23
|
24
|
25
|
26
|
27
|
28
|
|
29
|
30
|
31
|
|
|
|
|
|
From: <ba...@us...> - 2007-07-01 05:20:38
|
Revision: 481
http://svn.sourceforge.net/omc/?rev=481&view=rev
Author: bartw
Date: 2007-06-30 22:20:37 -0700 (Sat, 30 Jun 2007)
Log Message:
-----------
added OMC_RPMContainsFile
Modified Paths:
--------------
pysoftware/trunk/MANIFEST
pysoftware/trunk/OMC_InstalledRPMSoftwareIdentity.mof
pysoftware/trunk/OMC_InstalledRPMSoftwareIdentity.py
pysoftware/trunk/OMC_RPMSoftwareIdentity.py
pysoftware/trunk/setup.py
Added Paths:
-----------
pysoftware/trunk/OMC_RPMContainsFile.mof
pysoftware/trunk/OMC_RPMContainsFile.py
pysoftware/trunk/OMC_RPMContainsFile.reg
Modified: pysoftware/trunk/MANIFEST
===================================================================
--- pysoftware/trunk/MANIFEST 2007-06-30 18:51:43 UTC (rev 480)
+++ pysoftware/trunk/MANIFEST 2007-07-01 05:20:37 UTC (rev 481)
@@ -5,4 +5,7 @@
OMC_InstalledRPMSoftwareIdentity.mof
OMC_InstalledRPMSoftwareIdentity.py
OMC_InstalledRPMSoftwareIdentity.reg
+OMC_RPMContainsFile.mof
+OMC_RPMContainsFile.py
+OMC_RPMContainsFile.reg
setup.py
Modified: pysoftware/trunk/OMC_InstalledRPMSoftwareIdentity.mof
===================================================================
--- pysoftware/trunk/OMC_InstalledRPMSoftwareIdentity.mof 2007-06-30 18:51:43 UTC (rev 480)
+++ pysoftware/trunk/OMC_InstalledRPMSoftwareIdentity.mof 2007-07-01 05:20:37 UTC (rev 481)
@@ -1,4 +1,11 @@
class OMC_InstalledRPMSoftwareIdentity : CIM_InstalledSoftwareIdentity
{
+ [Key, Description (
+ "The system on which the software is installed.")]
+ OMC_UnitaryComputerSystem REF System;
+
+ [Key, Description (
+ "The SoftwareIdentity that is installed.")]
+ OMC_RPMSoftwareIdentity REF InstalledSoftware;
};
Modified: pysoftware/trunk/OMC_InstalledRPMSoftwareIdentity.py
===================================================================
--- pysoftware/trunk/OMC_InstalledRPMSoftwareIdentity.py 2007-06-30 18:51:43 UTC (rev 480)
+++ pysoftware/trunk/OMC_InstalledRPMSoftwareIdentity.py 2007-07-01 05:20:37 UTC (rev 481)
@@ -237,7 +237,7 @@
if (not role or role.lower() == 'installedsoftware') and \
pywbem.is_subclass(ch, object_name.namespace,
sub=object_name.classname,
- super='CIM_SoftwareIdentity'):
+ super='OMC_RPMSoftwareIdentity'):
model['InstalledSoftware'] = object_name
cs = pywbem.CIMInstanceName(classname='OMC_UnitaryComputerSystem',
namespace=object_name.namespace,
@@ -249,7 +249,7 @@
if (not role or role.lower() == 'system') and \
pywbem.is_subclass(ch, object_name.namespace,
sub=object_name.classname,
- super='CIM_System'):
+ super='OMC_UnitaryComputerSystem'):
model['System'] = object_name
iname = pywbem.CIMInstanceName(classname='OMC_RPMSoftwareIdentity',
namespace=object_name.namespace)
Added: pysoftware/trunk/OMC_RPMContainsFile.mof
===================================================================
--- pysoftware/trunk/OMC_RPMContainsFile.mof (rev 0)
+++ pysoftware/trunk/OMC_RPMContainsFile.mof 2007-07-01 05:20:37 UTC (rev 481)
@@ -0,0 +1,18 @@
+
+// TODO is there a better superclass??
+ [Association, Aggregation,
+ Description (
+ "OMC_RPMContainsFile is used to associate RPMs with the files they "
+ "contain")]
+class OMC_RPMContainsFile : CIM_Component
+{
+ [Key, Aggregate, Description (
+ "The RPM.")]
+ OMC_RPMSoftwareIdentity REF GroupComponent;
+
+ [Key, Description (
+ "The file.")]
+ CIM_LogicalFile REF PartComponent;
+
+};
+
Added: pysoftware/trunk/OMC_RPMContainsFile.py
===================================================================
--- pysoftware/trunk/OMC_RPMContainsFile.py (rev 0)
+++ pysoftware/trunk/OMC_RPMContainsFile.py 2007-07-01 05:20:37 UTC (rev 481)
@@ -0,0 +1,263 @@
+"""Python Provider for OMC_RPMContainsFile
+
+Instruments the CIM class OMC_RPMContainsFile
+
+"""
+
+import pywbem
+import rpm
+import OMC_RPMSoftwareIdentity
+import OMC_LogicalFile
+
+class OMC_RPMContainsFileProvider(pywbem.CIMProvider):
+ """Instrument the CIM class OMC_RPMContainsFile
+
+ OMC_RPMContainsFile is used to associate RPMs with the files they
+ contain
+
+ """
+
+ def __init__ (self, env):
+ logger = env.get_logger()
+ logger.log_debug('Initializing provider %s from %s' \
+ % (self.__class__.__name__, __file__))
+ # If you will be filtering instances yourself according to
+ # property_list, role, result_role, and result_class_name
+ # parameters, set self.filter_results to False
+ # self.filter_results = False
+
+ def get_instance(self, env, model, cim_class):
+ """Return an instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ model -- A template of the pywbem.CIMInstance to be returned. The
+ key properties are set on this instance to correspond to the
+ instanceName that was requested. The properties of the model
+ are already filtered according to the PropertyList from the
+ request. Only properties present in the model need to be
+ given values. If you prefer, you can set all of the
+ values, and the instance will be filtered for you.
+ cim_class -- The pywbem.CIMClass
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_NOT_FOUND (the CIM Class does exist, but the requested CIM
+ Instance does not exist in the specified namespace)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.get_instance()' \
+ % self.__class__.__name__)
+
+ return model
+
+ def enum_instances(self, env, model, cim_class, keys_only):
+ """Enumerate instances.
+
+ The WBEM operations EnumerateInstances and EnumerateInstanceNames
+ are both mapped to this method.
+ This method is a python generator
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ model -- A template of the pywbem.CIMInstances to be generated.
+ The properties of the model are already filtered according to
+ the PropertyList from the request. Only properties present in
+ the model need to be given values. If you prefer, you can
+ always set all of the values, and the instance will be filtered
+ for you.
+ cim_class -- The pywbem.CIMClass
+ keys_only -- A boolean. True if only the key properties should be
+ set on the generated instances.
+
+ Possible Errors:
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.enum_instances()' \
+ % self.__class__.__name__)
+
+ while False: # TODO more instances?
+ # TODO fetch system resource
+ # Key properties
+ #model['GroupComponent'] = # TODO (type = REF (pywbem.CIMInstanceName(classname='OMC_RPMSoftwareIdentity', ...))
+ #model['PartComponent'] = # TODO (type = REF (pywbem.CIMInstanceName(classname='CIM_LogicalFile', ...))
+ if keys_only:
+ yield model
+ else:
+ try:
+ yield self.get_instance(env, model, cim_class)
+ except pywbem.CIMError, (num, msg):
+ if num not in (pywbem.CIM_ERR_NOT_FOUND,
+ pywbem.CIM_ERR_ACCESS_DENIED):
+ raise
+
+ def set_instance(self, env, instance, previous_instance, cim_class):
+ """Return a newly created or modified instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ instance -- The new pywbem.CIMInstance. If modifying an existing
+ instance, the properties on this instance have been filtered by
+ the PropertyList from the request.
+ previous_instance -- The previous pywbem.CIMInstance if modifying
+ an existing instance. None if creating a new instance.
+ cim_class -- The pywbem.CIMClass
+
+ Return the new instance. The keys must be set on the new instance.
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_NOT_SUPPORTED
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_ALREADY_EXISTS (the CIM Instance already exists -- only
+ valid if previous_instance is None, indicating that the operation
+ was CreateInstance)
+ CIM_ERR_NOT_FOUND (the CIM Instance does not exist -- only valid
+ if previous_instance is not None, indicating that the operation
+ was ModifyInstance)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.set_instance()' \
+ % self.__class__.__name__)
+ # TODO create or modify the instance
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) # Remove to implement
+ return instance
+
+ def delete_instance(self, env, instance_name):
+ """Delete an instance.
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ instance_name -- A pywbem.CIMInstanceName specifying the instance
+ to delete.
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_NOT_SUPPORTED
+ CIM_ERR_INVALID_NAMESPACE
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_INVALID_CLASS (the CIM Class does not exist in the specified
+ namespace)
+ CIM_ERR_NOT_FOUND (the CIM Class does exist, but the requested CIM
+ Instance does not exist in the specified namespace)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.delete_instance()' \
+ % self.__class__.__name__)
+
+ # TODO delete the resource
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) # Remove to implement
+
+ def references(self, env, object_name, model, assoc_class,
+ result_class_name, role, result_role, keys_only):
+ """Instrument Associations.
+
+ All four association-related operations (Associators, AssociatorNames,
+ References, ReferenceNames) are mapped to this method.
+ This method is a python generator
+
+ Keyword arguments:
+ env -- Provider Environment (pycimmb.ProviderEnvironment)
+ object_name -- A pywbem.CIMInstanceName that defines the source
+ CIM Object whose associated Objects are to be returned.
+ model -- A template pywbem.CIMInstance to serve as a model
+ of the objects to be returned. Only properties present on this
+ model need to be set.
+ assoc_class -- The pywbem.CIMClass.
+ result_class_name -- If not empty, this string acts as a filter on
+ the returned set of Instances by mandating that each returned
+ Instances MUST represent an association between object_name
+ and an Instance of a Class whose name matches this parameter
+ or a subclass.
+ role -- If not empty, MUST be a valid Property name. It acts as a
+ filter on the returned set of Instances by mandating that each
+ returned Instance MUST refer to object_name via a Property
+ whose name matches the value of this parameter.
+ result_role -- If not empty, MUST be a valid Property name. It acts
+ as a filter on the returned set of Instances by mandating that
+ each returned Instance MUST represent associations of
+ object_name to other Instances, where the other Instances play
+ the specified result_role in the association (i.e. the
+ name of the Property in the Association Class that refers to
+ the Object related to object_name MUST match the value of this
+ parameter).
+ keys_only -- A boolean. True if only the key properties should be
+ set on the generated instances.
+
+ The following diagram may be helpful in understanding the role,
+ result_role, and result_class_name parameters.
+ +------------------------+ +-------------------+
+ | object_name.classname | | result_class_name |
+ | ~~~~~~~~~~~~~~~~~~~~~ | | ~~~~~~~~~~~~~~~~~ |
+ +------------------------+ +-------------------+
+ | +-----------------------------------+ |
+ | | [Association] assoc_class | |
+ | object_name | ~~~~~~~~~~~~~~~~~~~~~~~~~ | |
+ +--------------+ object_name.classname REF role | |
+ (CIMInstanceName) | result_class_name REF result_role +------+
+ | |(CIMInstanceName)
+ +-----------------------------------+
+
+ Possible Errors:
+ CIM_ERR_ACCESS_DENIED
+ CIM_ERR_NOT_SUPPORTED
+ CIM_ERR_INVALID_NAMESPACE
+ CIM_ERR_INVALID_PARAMETER (including missing, duplicate, unrecognized
+ or otherwise incorrect parameters)
+ CIM_ERR_FAILED (some other unspecified error occurred)
+
+ """
+
+ logger = env.get_logger()
+ logger.log_debug('Entering %s.references()' \
+ % self.__class__.__name__)
+ ch = env.get_cimom_handle()
+ if (not role or role.lower() == 'groupcomponent') and \
+ pywbem.is_subclass(ch, object_name.namespace,
+ sub=object_name.classname,
+ super='OMC_RPMSoftwareIdentity'):
+ model['GroupComponent'] = object_name
+ id = object_name['instanceid']
+ hdr = OMC_RPMSoftwareIdentity.get_rpm_hdr(id)
+ if hdr is None:
+ return
+ for fname in hdr[rpm.RPMTAG_FILENAMES]:
+ model['PartComponent'] = OMC_LogicalFile.get_file_path(fname)
+ yield model
+
+ if (not role or role.lower() == 'partcomponent') and \
+ pywbem.is_subclass(ch, object_name.namespace,
+ sub=object_name.classname,
+ super='CIM_LogicalFile'):
+ model['PartComponent'] = object_name
+ fname = object_name['name']
+ ts = rpm.ts()
+ mi = ts.dbMatch()
+ for hdr in mi:
+ if fname in hdr[rpm.RPMTAG_FILENAMES]:
+ iname = pywbem.CIMInstanceName(classname='OMC_RPMSoftwareIdentity', namespace=object_name.namespace)
+ iname['InstanceID'] = OMC_RPMSoftwareIdentity.get_rpm_instid(hdr)
+ model['GroupComponent'] = iname
+ yield model
+
+## end of class OMC_RPMContainsFileProvider
+
+def get_providers(env):
+ omc_rpmcontainsfile_prov = OMC_RPMContainsFileProvider(env)
+ return {'OMC_RPMContainsFile': omc_rpmcontainsfile_prov}
Added: pysoftware/trunk/OMC_RPMContainsFile.reg
===================================================================
--- pysoftware/trunk/OMC_RPMContainsFile.reg (rev 0)
+++ pysoftware/trunk/OMC_RPMContainsFile.reg 2007-07-01 05:20:37 UTC (rev 481)
@@ -0,0 +1,10 @@
+// Provider registration for OMC_RPMContainsFile
+instance of OpenWBEM_PyProviderRegistration
+{
+ InstanceID = "OMC:OMC_RPMContainsFile:01";
+ NamespaceNames = {"root/cimv2"};
+ ClassName = "OMC_RPMContainsFile";
+ ProviderTypes = {1,3}; // Instance, Associator
+ ModulePath = "/usr/lib/pycim/OMC_RPMContainsFile.py";
+};
+
Modified: pysoftware/trunk/OMC_RPMSoftwareIdentity.py
===================================================================
--- pysoftware/trunk/OMC_RPMSoftwareIdentity.py 2007-06-30 18:51:43 UTC (rev 480)
+++ pysoftware/trunk/OMC_RPMSoftwareIdentity.py 2007-07-01 05:20:37 UTC (rev 481)
@@ -7,6 +7,43 @@
import pywbem
import rpm
+def get_rpm_hdr(instid):
+ hdr = None
+ try:
+ adash = instid.rindex('-')
+ arch = instid[adash+1:]
+ edash = instid.rindex('-',0, adash)
+ epoch = instid[edash+1:adash]
+ rdash = instid.rindex('-',0, edash)
+ release = instid[rdash+1:edash]
+ vdash = instid.rindex('-',0, rdash)
+ version = instid[vdash+1:rdash]
+ name = instid[8:vdash]
+ ts = rpm.ts()
+ mi = ts.dbMatch('name', name)
+ if not epoch:
+ epoch = None
+ for tmp in mi:
+ if tmp[rpm.RPMTAG_VERSION] == version and \
+ tmp[rpm.RPMTAG_RELEASE] == release and \
+ tmp[rpm.RPMTAG_EPOCH] == epoch and \
+ tmp[rpm.RPMTAG_ARCH] == arch:
+ hdr = tmp
+ break
+ except ValueError:
+ return None
+ return hdr
+
+def get_rpm_instid(hdr):
+ epoch = hdr[rpm.RPMTAG_EPOCH]
+ if epoch is None:
+ epoch = ''
+ # Key properties
+ return 'OMC:RPM:%s-%s-%s-%s-%s' % \
+ (hdr[rpm.RPMTAG_NAME], hdr[rpm.RPMTAG_VERSION],
+ hdr[rpm.RPMTAG_RELEASE],
+ epoch, hdr[rpm.RPMTAG_ARCH])
+
class OMC_RPMSoftwareIdentityProvider(pywbem.CIMProvider):
r"""Instrument the CIM class OMC_RPMSoftwareIdentity
@@ -85,33 +122,9 @@
% self.__class__.__name__)
if hdr is None:
- id = model['instanceid']
- try:
- adash = id.rindex('-')
- arch = id[adash+1:]
- edash = id.rindex('-',0, adash)
- epoch = id[edash+1:adash]
- rdash = id.rindex('-',0, edash)
- release = id[rdash+1:edash]
- vdash = id.rindex('-',0, rdash)
- version = id[vdash+1:rdash]
- name = id[8:vdash]
- ts = rpm.ts()
- mi = ts.dbMatch('name', name)
- if not epoch:
- epoch = None
- for tmp in mi:
- if tmp[rpm.RPMTAG_VERSION] == version and \
- tmp[rpm.RPMTAG_RELEASE] == release and \
- tmp[rpm.RPMTAG_EPOCH] == epoch and \
- tmp[rpm.RPMTAG_ARCH] == arch:
- hdr = tmp
- break
- except ValueError:
- hdr = None
-
- if hdr is None:
- raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND, id)
+ hdr = get_rpm_hdr(model['instanceid'])
+ if hdr is None:
+ raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND, id)
#model['BuildNumber'] = # TODO (type = pywbem.Uint16)
model['Caption'] = hdr[rpm.RPMTAG_SUMMARY]
Modified: pysoftware/trunk/setup.py
===================================================================
--- pysoftware/trunk/setup.py 2007-06-30 18:51:43 UTC (rev 480)
+++ pysoftware/trunk/setup.py 2007-07-01 05:20:37 UTC (rev 481)
@@ -13,7 +13,8 @@
description='Software Inventory Providers',
url='http://omc-project.org/',
py_modules=['OMC_RPMSoftwareIdentity',
- 'OMC_InstalledRPMSoftwareIdentity'],
+ 'OMC_InstalledRPMSoftwareIdentity',
+ 'OMC_RPMContainsFile'],
#options={'install':{'--install-lib':'/usr/lib/pycim'}},
)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|