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
|
From: <jc...@us...> - 2007-12-13 22:02:24
|
Revision: 507 http://omc.svn.sourceforge.net/omc/?rev=507&view=rev Author: jcarey Date: 2007-12-13 14:02:25 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Added files for python OMC_TimeService Modified Paths: -------------- pybase/trunk/OMC_Base.mof Added Paths: ----------- pybase/trunk/OMC_TimeService-peg.reg pybase/trunk/OMC_TimeService.mof pybase/trunk/OMC_TimeService.py pybase/trunk/OMC_TimeService.reg Modified: pybase/trunk/OMC_Base.mof =================================================================== --- pybase/trunk/OMC_Base.mof 2007-12-07 06:02:50 UTC (rev 506) +++ pybase/trunk/OMC_Base.mof 2007-12-13 22:02:25 UTC (rev 507) @@ -3,3 +3,5 @@ #pragma include ("OMC_LogicalFile.mof") #pragma include ("OMC_UnixProcess.mof") #pragma include ("OMC_InitdService.mof") +#pragma include ("OMC_InitdService.mof") +#pragma include ("OMC_TimeService.mof") Added: pybase/trunk/OMC_TimeService-peg.reg =================================================================== --- pybase/trunk/OMC_TimeService-peg.reg (rev 0) +++ pybase/trunk/OMC_TimeService-peg.reg 2007-12-13 22:02:25 UTC (rev 507) @@ -0,0 +1,95 @@ +instance of PG_ProviderModule +{ + Name = "OMC_TimeServiceProvider_Module"; + InterfaceType = "Python"; + InterfaceVersion = "1.0.0"; + Location = "/usr/lib/pycim/OMC_TimeService.py"; + Vendor = "OMC"; + Version = "1.0"; +}; +instance of PG_Provider +{ + Name = "OMC_TimeService_Provider"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability1"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService_Provider"; + ClassName = "OMC_TimeService"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,5}; // Instance, Method +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability2"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService_Provider"; + ClassName = "OMC_RemoteTimeServicePort"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,5}; // Instance, Method +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability3"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService_Provider"; + ClassName = "OMC_TimeZoneSettingData"; + Namespaces = {"root/cimv2"}; + ProviderType = {2}; // Instance +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability4"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService_Provider"; + ClassName = "OMC_HostedTimeService"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Associator +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability5"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService_Provider"; + ClassName = "OMC_TimeServiceAccessBySAP"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Associator +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability6"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService_Provider"; + ClassName = "OMC_TimeServiceTimeZoneSettingData"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Associator +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability7"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService_Provider"; + ClassName = "OMC_TimeServiceAvailableToElement"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Associator +}; + + + + + + + + + + + Added: pybase/trunk/OMC_TimeService.mof =================================================================== --- pybase/trunk/OMC_TimeService.mof (rev 0) +++ pybase/trunk/OMC_TimeService.mof 2007-12-13 22:02:25 UTC (rev 507) @@ -0,0 +1,219 @@ +#pragma locale ("en_US") + + +////////////////////////////////////////////////////////////////////////////// +[ Abstract ] +class OMC_TimeService : CIM_TimeService +{ +}; + +////////////////////////////////////////////////////////////////////////////// +// OMC_SystemTimeService +[ Description("OMC_SystemTimeService represents the configuration " + " and function of the system time") ] +class OMC_SystemTimeService : OMC_TimeService +{ + [ Key, Override("SystemCreationClassName") ] + string SystemCreationClassName; + + [ Key, Override("SystemName") ] + string SystemName; + + [ Key, Override("CreationClassName") ] + string CreationClassName = "OMC_SystemTimeService"; + + [ Key, Override("Name") ] + string Name = "timeservice"; + + [ Static(true), + Description ( + "This method gets or sets the time for the system."), + ValueMap { "0", "1", "2", "3", "4", "5", "6..32767", + "32768..65535" }, + Values { "Success", "Not Supported", "Unknown", "Timeout", + "Failed", "Invalid Parameter", "DMTF Reserved", + "Vendor Specific" } ] + uint32 ManageSystemTime ( + [ IN, DESCRIPTION ( + "Indicates what type of request this is: " + "TRUE - Get time request " + "FALSE - Set time request.") ] + boolean GetRequest, + + [ IN, OUT, DESCRIPTION ( + "The current date and time. On input, this is the time " + "that is set on the specified element, if the GetRequest " + "input parameter is TRUE. Otherwise, the input time is " + "ignored. On output, this is the time as known by the " + "element.") ] + datetime TimeData); + + [ INVISIBLE(true), + Description ( + "NOT IMPLEMENTED - DON'T USE. " + "This method is inherited from CIM_TimeService. " + "Since this method always pertains to the ComputerSystem, " + "The ManagedElement element parameter is not necessary. " + "For this reason the ManageSystemTime method should be " + "used instead of ManageTime") ] + uint32 ManageTime ( + [ IN ] + boolean GetRequest, + [ IN, OUT ] + datetime TimeData, + [ REQUIRED, IN ] + CIM_ManagedElement REF ManagedElement); +}; + +////////////////////////////////////////////////////////////////////////////// +// OMC_RemoteTimeServicePort +[ Description("OMC_RemoteTimeServicePort represent the NTP " + "configuration for the time service") ] +class OMC_RemoteTimeServicePort : CIM_RemotePort +{ + [ Override("AccessInfo"), Write(true), + Description ( + "Access and/or addressing information for a remote " + "connection. This can be a host name, network address or " + "similar information. This is inherited from " + "CIM_RemoteServiceAccessPoint"), + ModelCorrespondence { "CIM_RemoteServiceAccessPoint.InfoFormat"} ] + string AccessInfo; + + [ Override("PortInfo"), Write(true), + Description("Address of remote NTP server. This is " + " inherited from CIM_RemotePort. This will be in " + " the form of a DNS name of an IP address. " + " A port may be specified in this field by using " + " the ':' character as a delimeter. Example: " + " 137.65.1.1:123 or time.server.com:123 " + " If not port is specified the NTP well known port " + " (123) will be assumed") ] + string PortInfo; + + [Description ("An enumerated integer describing the protocol of the port " + "addressed by PortInformation."), + ValueMap { "1", "2", "3", "32768..65535" }, + Values { "Other", "TCP", "UDP", "Vendor Specific" }, + ModelCorrespondence { "CIM_RemotePort.OtherProtocolDescription"}] + uint16 PortProtocol = 2; + + [ Description ("The Prefer property Marks the host as a preferred " + "time source. This host is not subject to preliminary filtering.") ] + boolean Prefer; + + [ Description ("The Key property specifies that all packets sent to " + "the time source include authentication fields encrypted using the " + "specified key number. The value of Key is the range of an " + "unsigned 32 bit integer.") ] + uint32 Key; + + [ Description( + "The NTPversion property specifies the version number to use for " + "outgoing NTP packets. The values for NTPversion can be 1 thru 4."), + ValueMap { "1", "2", "3", "4" } ] + uint32 NTPversion; + + [ Description( + "The MinPoll property specifies the minimum poll interval allowed by " + "any peer of the Internet system. The minimum poll interval is " + "calculated, in seconds, as 2 to the power of minpoll value. " + "The default value of minpoll is 6, i.e. the corresponding poll " + "interval is 64 seconds.") ] + uint32 MinPoll; + + [ Description( + "The MaxPoll property specifies the maximum poll interval allowed by " + "any peer of the Internet system. The maximum poll interval is " + "calculated, in seconds, as 2 to the power of maxpoll value. " + "The default value of maxpoll is 10, therefore the corresponding " + "poll interval is ~17 minutes.") ] + uint32 MaxPoll; +}; + +////////////////////////////////////////////////////////////////////////////// +// OMC_TimeZoneSettingData +[ Description("OMC_TimeZoneSettingData represents the " + "configuration of the system time zone.") ] +class OMC_TimeZoneSettingData : CIM_SettingData +{ + [ Key, Description( + "InstanceID is the key field inherited from CIM_SettingData. " + "Since there is only one instance of this class, the key " + "value is 'OMC:SUSE:TIMEZONE'") ] + string InstanceID; + + [ Required(true), Description("The time zone"), + Write(true) ] + string TimeZone; + + [ Description("If the value of UTCHardwareClock is set to true, " + " then the hardware clock is set to UTC. Otherwise the " + " hardware clock is set to local time."), + Write(true) ] + boolean UTCHardwareClock = true; +}; + +////////////////////////////////////////////////////////////////////////////// +// OMC_HostedTimeService +[ Association, + Description("OMC_HostedTimeService associates the time service " + "to the computer system") ] +class OMC_HostedTimeService : CIM_HostedService +{ + [ Override("Antecedent"), Min(1), Max(1), + Description("The hosting computer system") ] + OMC_UnitaryComputerSystem REF Antecedent; + + [ Override("Dependent"), Weak, + Description("The hosted system time service") ] + OMC_SystemTimeService REF Dependent; +}; + +////////////////////////////////////////////////////////////////////////////// +// OMC_TimeServiceAccessBySAP +[ Association, + Description("OMC_TimeServiceAccessBySAP is an association " + "that identifies the configuration for NTP access for the " + "time service") ] +class OMC_TimeServiceAccessBySAP : CIM_ServiceAccessBySAP +{ + [ Override("Antecedent"), + Description("The time service") ] + OMC_SystemTimeService REF Antecedent; + + [ Override("Dependent"), + Description("Access point for the time service") ] + OMC_RemoteTimeServicePort REF Dependent; +}; + +////////////////////////////////////////////////////////////////////////////// +// OMC_TimeServiceTimeZoneSettingData +// +[ Association, + Description("OMC_TimeServiceTimeZoneSettingData associates the time " + "service with the time zone configuration") ] +class OMC_TimeServiceTimeZoneSettingData : CIM_ElementSettingData +{ + [ Override("ManagedElement") ] + OMC_SystemTimeService REF ManagedElement; + + [ Override("SettingData") ] + OMC_TimeZoneSettingData REF SettingData; +}; + + +////////////////////////////////////////////////////////////////////////////// +// OMC_TimeServiceAvailableToElement +[ Association, + Description("OMC_TimeServiceAvailableToElement indicates that this time " + "service is available for the use of the managed element") ] +class OMC_TimeServiceAvailableToElement : CIM_ServiceAvailableToElement +{ + [ Override("ServiceProvided") ] + OMC_TimeService REF ServiceProvided; + + [ Override("UserOfService") ] + CIM_ManagedElement REF UserOfService; +}; + Added: pybase/trunk/OMC_TimeService.py =================================================================== --- pybase/trunk/OMC_TimeService.py (rev 0) +++ pybase/trunk/OMC_TimeService.py 2007-12-13 22:02:25 UTC (rev 507) @@ -0,0 +1,226 @@ +import os +import socket +import tempfile + +import pywbem + +_fqdn = socket.getfqdn() + +def _clock_conf_key_value(line): + tline = line.strip(' \n\r') + if not len(sl) or sl.startswith('#'): + return None + ndx = tline.find('=') + if ndx != -1: + key = tline[0:ndx].strip() + value = tline[ndx+1:].strip(' "') + return (key,value) + return None + +def _clock_conf_get_time_zone(): + is_utc = False + timezone = '' + cnt = 0 + try: + f = open('/etc/sysconfig/clock') + except: + return None + + try: + for line in f: + kv = _clock_conf_key_value(line) + if kv is not None: + if kv[0].lower() == 'hwclock': + is_utc = (kv[1].lower() == '-u') + cnt += 1 + elif kv[0].lower() == 'timezone': + timezone = kv[1] + cnt += 1 + if cnt > 1: + break + return (is_utc, timezone) + finally: + f.close() + +def _clock_conf_modify(is_utc, timezone): + modified = False + tfname = None + utc_val = is_utc and '"-u"' or '"--localtime"' + tfd,tfname = tempfile.mkstemp(dir='/etc/sysconfig') + tfile = os.fdopen(tfd, 'w') + cfile = open('/etc/sysconfig/clock') + try: + for line in cfile: + kv = _clock_conf_key_value(line) + if kv is None: + tfile.write(line) + continue + if kv[0].lower() == 'hwclock': + tfile.write('HWCLOCK=%s\n' % utc_val) + modified = True + elif kv[0].lower() == 'timezone': + tfile.write('TIMEZONE=%s\n' % timezone) + modified = True + else: + tfile.write(line) + tfile.close() + cfile.close() + if not modified: + os.unlink(tfname) + else: + os.unlink('/etc/sysconfig/clock') + os.rename(tfname, '/etc/sysconfig/clock') + except Exception,einst: + tfile.close() + cfile.close() + if tfname: + try: + os.unlink(tfname) + except: + pass + raise einst + +def _is_service_ref(model): + for nm in ['SystemCreationClassName' 'SystemName', 'CreationClassName', 'Name']: + if nm not in model: + return False + if model['SystemCreationClassName'].lower() != 'omc_unitarycomputersystem': + return False + if model['SystemName'].lower() != _fqdn.lower(): + return False + if model['CreationClassName'].lower() = 'omc_systemtimeservice': + return False + return model['Name'].lower() == 'timeservice' + +def _fill_service_instance(model, keys_only): + model['SystemCreationClassName'] = 'OMC_UnitaryComputerSystem' + model['SystemName'] = _fqdn + model['CreationClassName'] = 'OMC_SystemTimeService' + model['Name'] = 'timeservice' + if not keys_only: + model['EnabledState'] = pywbem.Uint16(2) + model['RequestedState'] = pywbem.Uint16(12) + model['EnabledDefault'] = pywbem.Uint16(2) + model['TimeOfLastStateChange'] = pywbem.CIMDateTime( + '00000000000000.000000:000') + model['Started'] = True + model['InstallDate'] = pywbem.CIMDateTime( + '00000000000000.000000:000') + model['OperationalStatus'] = [pywbem.Uint16(2)] + model['Status'] = 'OK' + model['HealthState'] = pywbem.Uint16(5) + model['StartMode'] = 'Automatic' + return model + +class OMC_TimeServiceProvider(pywbem.CIMProvider): + """Instrument the CIM class OMC_TimeService""" + + 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): + logger = env.get_logger() + logger.log_debug('Entering %s.get_instance()' \ + % self.__class__.__name__) + if not _is_service_ref(model): + raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND) + return _fill_service_instance(model, false) + + def enum_instances(self, env, model, cim_class, keys_only): + logger = env.get_logger() + logger.log_debug('Entering %s.enum_instances()' \ + % self.__class__.__name__) + yield _fill_service_instance(model, keys_only) + + def set_instance(self, env, instance, previous_instance, cim_class): + raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) + + def delete_instance(self, env, instance_name): + raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED) + + def cim_method_requeststatechange(self, env, object_name, method, + param_requestedstate, + param_timeoutperiod): + # Not supported + return (pywbem.Uint32(1), {}) + + def cim_method_startservice(self, env, object_name, method): + # Not supported + return (pywbem.Uint32(1), {}) + + def cim_method_stopservice(self, env, object_name, method): + # Not supported + return (pywbem.Uint32(1), {}) + + def cim_method_managetime(self, env, object_name, method, + param_timedata, + param_getrequest, + param_managedelement): + logger = env.get_logger() + logger.log_debug('Entering %s.cim_method_managetime()' \ + % self.__class__.__name__) + if not _is_service_ref(object_name): + raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND) + if param_getrequest: # Is this a 'get' request? + return (pywbem.Uint32(0), + {'TimeData':pywbem.CIMDateTime.now()}) + + # At this point we know it is a 'set' request + if os.geteuid() != 0: + raise pywbem.CIMError(pywbem.CIM_ERR_ACCESS_DENIED, + 'You must have admin privileges on this machine ' + 'in order to set the time') + + if not param_timedata: + raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_PARAMETER, + "'TimeData' parameter is required for a set operation") + if param_timedata.is_interval: + raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_PARAMETER, + "'TimeData' parameter must be a timestamp and not an " + "interval") + new_time = param_timedata.datetime.ctime() + + ccval = _clock_conf_get_time_zone() + if ccval is not None: + is_utc, timezone = ccval + else: + is_utc = False + + try: + # Set the system time + dt = param_timedata.datetime + dtstr = '%02d%02d%02d%02d%04d' % \ + (dt.month, dt.day, dt.hour, dt.minute, dt.year) + cc = os.system('/bin/date %s' % dtstr) + if cc: + raise Exception('Error returned from date command: %d' \ + % int(cc)) + except Exception,inst: + raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, + 'Exception encountered trying to set hardware clock: %s' \ + % str(inst)) + try: + # Set the hardware clock + cmd = '/sbin/hwclock --systohc ' + cmd += is_utc and '-u' or '--localtime' + cc = os.system(cmd) + if cc: + raise Exception('Error returned from hwclock: %d' \ + % int(cc)) + except Exception,inst: + raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, + 'Exception encountered syncing hardware clock with system ' \ + 'time' % str(inst)) + return (pywbem.Uint32(0), {}) + +## end of class OMC_TimeServiceProvider + +def get_providers(env): + omc_timeservice_prov = OMC_TimeServiceProvider(env) + return {'OMC_TimeService': omc_timeservice_prov} Added: pybase/trunk/OMC_TimeService.reg =================================================================== --- pybase/trunk/OMC_TimeService.reg (rev 0) +++ pybase/trunk/OMC_TimeService.reg 2007-12-13 22:02:25 UTC (rev 507) @@ -0,0 +1,66 @@ +// OpenWBEM Provider registration for OMC_TimeService +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC_TimeService:0001"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_TimeService"; + ProviderTypes = {1,6}; // Instance, Method + ModulePath = "/usr/lib/pycim/OMC_TimeService.py"; +}; + +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC_TimeService:0002"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_RemoteTimeServicePort"; + ProviderTypes = {1,6}; // Instance, Method + ModulePath = "/usr/lib/pycim/OMC_TimeService.py"; +}; + +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC_TimeService:0003"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_TimeZoneSettingData"; + ProviderTypes = {1}; // Instance + ModulePath = "/usr/lib/pycim/OMC_TimeService.py"; +}; + +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC_TimeService:0004"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_HostedTimeService"; + ProviderTypes = {1,3}; // Instance, Associator + ModulePath = "/usr/lib/pycim/OMC_TimeService.py"; +}; + +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC_TimeService:0005"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_TimeServiceAccessBySAP"; + ProviderTypes = {1,3}; // Instance, Associator + ModulePath = "/usr/lib/pycim/OMC_TimeService.py"; +}; + +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC_TimeService:0006"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_TimeServiceTimeZoneSettingData"; + ProviderTypes = {1,3}; // Instance, Associator + ModulePath = "/usr/lib/pycim/OMC_TimeService.py"; +}; + +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC_TimeService:0007"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_TimeServiceAvailableToElement"; + ProviderTypes = {1,3}; // Instance, Associator + ModulePath = "/usr/lib/pycim/OMC_TimeService.py"; +}; + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2007-12-07 06:02:51
|
Revision: 506 http://omc.svn.sourceforge.net/omc/?rev=506&view=rev Author: bartw Date: 2007-12-06 22:02:50 -0800 (Thu, 06 Dec 2007) Log Message: ----------- added some more properties Modified Paths: -------------- pybase/trunk/OMC_OperatingSystem.py Modified: pybase/trunk/OMC_OperatingSystem.py =================================================================== --- pybase/trunk/OMC_OperatingSystem.py 2007-12-07 00:08:48 UTC (rev 505) +++ pybase/trunk/OMC_OperatingSystem.py 2007-12-07 06:02:50 UTC (rev 506) @@ -37,6 +37,9 @@ import pywbem from pywbem import CIMProvider from socket import getfqdn +import os +import time +from subprocess import Popen, PIPE def get_os_path(ns): return pywbem.CIMInstanceName(classname='OMC_OperatingSystem', @@ -86,6 +89,7 @@ for line in fo.readlines(): sline = line.split(':') meminfo[sline[0].strip()] = int(sline[1].split()[0]) + fo.close() uex = model.update_existing @@ -93,32 +97,45 @@ uex(FreePhysicalMemory = pywbem.Uint64(meminfo['MemFree'])) uex(FreeVirtualMemory = pywbem.Uint64(meminfo['MemFree'] + meminfo['Buffers'] + meminfo['Cached'])) + uex(TotalVisibleMemorySize = pywbem.Uint64(meminfo['MemTotal'])) uex(TotalVirtualMemorySize = pywbem.Uint64(meminfo['MemTotal'] + meminfo['SwapTotal'])) fnames = os.listdir('/proc') numprocs = len([x for x in fnames if x.isdigit()]) uex(NumberOfProcesses = pywbem.Uint32(numprocs)) + uex(CurrentTimeZone = pywbem.Sint16(time.timezone / 60)) + uex(LocalDateTime = pywbem.CIMDateTime.now()) + fo = open('/proc/uptime', 'r') + uex(LastBootUpTime = pywbem.CIMDateTime.fromtimestamp( + time.time() - float(fo.read().split()[0]))) + fo.close() + if os.path.exists('/etc/SuSE-release'): + fo = open('/etc/SuSE-release', 'r') + version = fo.readline().strip() + uex(Version = version) + uex(ElementName = version) + uex(Description = version) + uex(Caption = version) + fo.close() + install_time = Popen(['rpm', '-qf','/etc/SuSE-release', + '--queryformat','%{INSTALLTIME}'], + stdout=PIPE).communicate()[0] + uex(InstallDate = pywbem.CIMDateTime.fromtimestamp(int(install_time))) + # TODO non-SUSE distros - #model['Caption'] = # TODO (type = unicode) - #model['CurrentTimeZone'] = # TODO (type = pywbem.Sint16) - #model['Description'] = # TODO (type = unicode) - #model['Distributed'] = # TODO (type = bool) - #model['ElementName'] = # TODO (type = unicode) + uex(Distributed = True) #model['EnabledDefault'] = # TODO (type = pywbem.Uint16 self.Values.EnabledDefault) (default=2L) - #model['EnabledState'] = # TODO (type = pywbem.Uint16 self.Values.EnabledState) (default=5L) + uex(EnabledState = self.Values.EnabledState.Enabled) #model['FreeSpaceInPagingFiles'] = # TODO (type = pywbem.Uint64) - #model['HealthState'] = # TODO (type = pywbem.Uint16 self.Values.HealthState) - #model['InstallDate'] = # TODO (type = pywbem.CIMDateTime) - #model['LastBootUpTime'] = # TODO (type = pywbem.CIMDateTime) - #model['LocalDateTime'] = # TODO (type = pywbem.CIMDateTime) + uex(HealthState = self.Values.HealthState.OK) #model['MaxNumberOfProcesses'] = # TODO (type = pywbem.Uint32) #model['MaxProcessesPerUser'] = # TODO (type = pywbem.Uint32) #model['MaxProcessMemorySize'] = # TODO (type = pywbem.Uint64) #model['NumberOfLicensedUsers'] = # TODO (type = pywbem.Uint32) #model['NumberOfUsers'] = # TODO (type = pywbem.Uint32) - #model['OperationalStatus'] = # TODO (type = [pywbem.Uint16,] self.Values.OperationalStatus) + uex(OperationalStatus = [self.Values.OperationalStatus.OK]) uex(OSType = self.Values.OSType.LINUX) #model['OtherEnabledState'] = # TODO (type = unicode) #model['OtherTypeDescription'] = # TODO (type = unicode) @@ -127,8 +144,6 @@ #model['Status'] = # TODO (type = unicode self.Values.Status) #model['StatusDescriptions'] = # TODO (type = [unicode,]) #model['TimeOfLastStateChange'] = # TODO (type = pywbem.CIMDateTime) - #model['TotalVisibleMemorySize'] = # TODO (type = pywbem.Uint64) - #model['Version'] = # TODO (type = unicode) return model def enum_instances(self, env, model, cim_class, keys_only): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bni...@us...> - 2007-12-07 00:08:49
|
Revision: 505 http://omc.svn.sourceforge.net/omc/?rev=505&view=rev Author: bnicholes Date: 2007-12-06 16:08:48 -0800 (Thu, 06 Dec 2007) Log Message: ----------- Set the configuration file path before initializing the CLP session Modified Paths: -------------- clp/trunk/src/omcclpdsvrconnection.cpp Modified: clp/trunk/src/omcclpdsvrconnection.cpp =================================================================== --- clp/trunk/src/omcclpdsvrconnection.cpp 2007-12-06 01:44:43 UTC (rev 504) +++ clp/trunk/src/omcclpdsvrconnection.cpp 2007-12-07 00:08:48 UTC (rev 505) @@ -149,6 +149,8 @@ Int32 timeout = item.toInt32(); OMCCLPProgramRef clpref(new OMCCLPDaemon(sostr)); + clpref->setConfFilename (m_pServer->getEnv()->getConfigItem( + OMCClpdConfigOpts::CONFIG_FILE_opt, OMCCLPD_DEFAULT_CONFIG_FILE)); clpref->setLogger(logger); if (clpref->initializeCLPSession() && clpref->createCLPSessionInfo(clpref->getCIMClient())) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2007-12-06 01:44:38
|
Revision: 504 http://omc.svn.sourceforge.net/omc/?rev=504&view=rev Author: bartw Date: 2007-12-05 17:44:43 -0800 (Wed, 05 Dec 2007) Log Message: ----------- added some more OS properties Modified Paths: -------------- pybase/trunk/OMC_OperatingSystem.py Modified: pybase/trunk/OMC_OperatingSystem.py =================================================================== --- pybase/trunk/OMC_OperatingSystem.py 2007-11-27 00:20:59 UTC (rev 503) +++ pybase/trunk/OMC_OperatingSystem.py 2007-12-06 01:44:43 UTC (rev 504) @@ -81,6 +81,26 @@ logger.log_debug('Entering %s.get_instance()' \ % self.__class__.__name__) + meminfo = {} + fo = open('/proc/meminfo', 'r') + for line in fo.readlines(): + sline = line.split(':') + meminfo[sline[0].strip()] = int(sline[1].split()[0]) + + uex = model.update_existing + + uex(TotalSwapSpaceSize = pywbem.Uint64(meminfo['SwapTotal'])) + uex(FreePhysicalMemory = pywbem.Uint64(meminfo['MemFree'])) + uex(FreeVirtualMemory = pywbem.Uint64(meminfo['MemFree'] + + meminfo['Buffers'] + meminfo['Cached'])) + uex(TotalVirtualMemorySize = pywbem.Uint64(meminfo['MemTotal'] + + meminfo['SwapTotal'])) + + fnames = os.listdir('/proc') + numprocs = len([x for x in fnames if x.isdigit()]) + uex(NumberOfProcesses = pywbem.Uint32(numprocs)) + + #model['Caption'] = # TODO (type = unicode) #model['CurrentTimeZone'] = # TODO (type = pywbem.Sint16) #model['Description'] = # TODO (type = unicode) @@ -88,9 +108,7 @@ #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) - #model['FreePhysicalMemory'] = # TODO (type = pywbem.Uint64) #model['FreeSpaceInPagingFiles'] = # TODO (type = pywbem.Uint64) - #model['FreeVirtualMemory'] = # TODO (type = pywbem.Uint64) #model['HealthState'] = # TODO (type = pywbem.Uint16 self.Values.HealthState) #model['InstallDate'] = # TODO (type = pywbem.CIMDateTime) #model['LastBootUpTime'] = # TODO (type = pywbem.CIMDateTime) @@ -99,10 +117,9 @@ #model['MaxProcessesPerUser'] = # TODO (type = pywbem.Uint32) #model['MaxProcessMemorySize'] = # TODO (type = pywbem.Uint64) #model['NumberOfLicensedUsers'] = # TODO (type = pywbem.Uint32) - #model['NumberOfProcesses'] = # TODO (type = pywbem.Uint32) #model['NumberOfUsers'] = # TODO (type = pywbem.Uint32) #model['OperationalStatus'] = # TODO (type = [pywbem.Uint16,] self.Values.OperationalStatus) - model['OSType'] = self.Values.OSType.LINUX + uex(OSType = self.Values.OSType.LINUX) #model['OtherEnabledState'] = # TODO (type = unicode) #model['OtherTypeDescription'] = # TODO (type = unicode) #model['RequestedState'] = # TODO (type = pywbem.Uint16 self.Values.RequestedState) (default=12L) @@ -110,8 +127,6 @@ #model['Status'] = # TODO (type = unicode self.Values.Status) #model['StatusDescriptions'] = # TODO (type = [unicode,]) #model['TimeOfLastStateChange'] = # TODO (type = pywbem.CIMDateTime) - #model['TotalSwapSpaceSize'] = # TODO (type = pywbem.Uint64) - #model['TotalVirtualMemorySize'] = # TODO (type = pywbem.Uint64) #model['TotalVisibleMemorySize'] = # TODO (type = pywbem.Uint64) #model['Version'] = # TODO (type = unicode) return model This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2007-11-27 00:20:54
|
Revision: 503 http://omc.svn.sourceforge.net/omc/?rev=503&view=rev Author: bartw Date: 2007-11-26 16:20:59 -0800 (Mon, 26 Nov 2007) Log Message: ----------- changes to support Pegasus Modified Paths: -------------- pybase/trunk/OMC_InitdService.mof pybase/trunk/omc-pybase-providers.spec pybase/trunk/setup.py Added Paths: ----------- pybase/trunk/MANIFEST.in pybase/trunk/OMC_InitdService-ow.reg pybase/trunk/OMC_InitdService-peg.reg pybase/trunk/OMC_LogicalFile-ow.reg pybase/trunk/OMC_LogicalFile-peg.reg pybase/trunk/OMC_OperatingSystem-ow.reg pybase/trunk/OMC_OperatingSystem-peg.reg pybase/trunk/OMC_UnitaryComputerSystem-ow.reg pybase/trunk/OMC_UnitaryComputerSystem-peg.reg pybase/trunk/OMC_UnixProcess-ow.reg pybase/trunk/OMC_UnixProcess-peg.reg Removed Paths: ------------- pybase/trunk/MANIFEST pybase/trunk/OMC_InitdService.reg pybase/trunk/OMC_LogicalFile.reg pybase/trunk/OMC_OperatingSystem.reg pybase/trunk/OMC_UnitaryComputerSystem.reg pybase/trunk/OMC_UnixProcess.reg Deleted: pybase/trunk/MANIFEST =================================================================== --- pybase/trunk/MANIFEST 2007-10-06 17:09:06 UTC (rev 502) +++ pybase/trunk/MANIFEST 2007-11-27 00:20:59 UTC (rev 503) @@ -1,17 +0,0 @@ -OMC_Base.mof -OMC_InitdService.py -OMC_InitdService.mof -OMC_InitdService.reg -OMC_LogicalFile.py -OMC_LogicalFile.mof -OMC_LogicalFile.reg -OMC_OperatingSystem.py -OMC_OperatingSystem.mof -OMC_OperatingSystem.reg -OMC_UnitaryComputerSystem.py -OMC_UnitaryComputerSystem.mof -OMC_UnitaryComputerSystem.reg -OMC_UnixProcess.py -OMC_UnixProcess.mof -OMC_UnixProcess.reg -setup.py Added: pybase/trunk/MANIFEST.in =================================================================== --- pybase/trunk/MANIFEST.in (rev 0) +++ pybase/trunk/MANIFEST.in 2007-11-27 00:20:59 UTC (rev 503) @@ -0,0 +1,2 @@ +include *.reg +include *.mof Added: pybase/trunk/OMC_InitdService-ow.reg =================================================================== --- pybase/trunk/OMC_InitdService-ow.reg (rev 0) +++ pybase/trunk/OMC_InitdService-ow.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -0,0 +1,10 @@ +// Provider registration for OMC_InitdService +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_InitdService:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_InitdService"; + ProviderTypes = {1,6}; // Instance, Method + ModulePath = "/usr/lib/pycim/OMC_InitdService.py"; +}; + Added: pybase/trunk/OMC_InitdService-peg.reg =================================================================== --- pybase/trunk/OMC_InitdService-peg.reg (rev 0) +++ pybase/trunk/OMC_InitdService-peg.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -0,0 +1,27 @@ +//////// OMC_InitdService +instance of PG_ProviderModule +{ + Name = "/usr/lib/pycim/OMC_InitdService.py"; + InterfaceType = "Python"; + InterfaceVersion = "1.0.0"; + Location = "/usr/lib/pycim/OMC_InitdService.py"; + Vendor = "OMC"; + Version = "0.1.0"; +}; + +instance of PG_Provider +{ + Name = "OMC_InitdService"; + ProviderModuleName = "/usr/lib/pycim/OMC_InitdService.py"; +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_InitdService"; + ProviderModuleName = "/usr/lib/pycim/OMC_InitdService.py"; + ProviderName = "OMC_InitdService"; + ClassName = "OMC_InitdService"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,5}; // Instance, Method +}; + Modified: pybase/trunk/OMC_InitdService.mof =================================================================== --- pybase/trunk/OMC_InitdService.mof 2007-10-06 17:09:06 UTC (rev 502) +++ pybase/trunk/OMC_InitdService.mof 2007-11-27 00:20:59 UTC (rev 503) @@ -11,12 +11,10 @@ "for more information.") ] class OMC_InitdService : CIM_Service { - [Key, Propagated ( "OMC_UnitaryComputerSystem.CreationClassName" ), - Description ("The CreationClassName of the scoping System.")] + [Key, Description ("The CreationClassName of the scoping System.")] string SystemCreationClassName; - [Key, Propagated ( "OMC_UnitaryComputerSystem.Name" ), - Description ("The Name of the scoping System.")] + [Key, Description ("The Name of the scoping System.")] string SystemName; [Key, Override ( "Name" ), @@ -104,10 +102,10 @@ "init scripts, in this case, a collection of OMC_InitdService objects")] class OMC_Runlevel : CIM_CollectionOfMSEs { - [ Key, Propagated("OMC_UnitaryComputerSystem.CreationClassName") ] + [ Key ] string SystemCreationClassName; - [ Key, Propagated("OMC_UnitaryComputerSystem.Name") ] + [ Key ] string SystemName; [ Description("The runlevel of this instance. This is typically a one-character identifier such as " Deleted: pybase/trunk/OMC_InitdService.reg =================================================================== --- pybase/trunk/OMC_InitdService.reg 2007-10-06 17:09:06 UTC (rev 502) +++ pybase/trunk/OMC_InitdService.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -1,10 +0,0 @@ -// Provider registration for OMC_InitdService -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_InitdService:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_InitdService"; - ProviderTypes = {1,6}; // Instance, Method - ModulePath = "/usr/lib/pycim/OMC_InitdService.py"; -}; - Added: pybase/trunk/OMC_LogicalFile-ow.reg =================================================================== --- pybase/trunk/OMC_LogicalFile-ow.reg (rev 0) +++ pybase/trunk/OMC_LogicalFile-ow.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -0,0 +1,82 @@ + +// Provider registration for OMC_LinuxDirectoryContainsFile +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_LinuxDirectoryContainsFile:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_LinuxDirectoryContainsFile"; + ProviderTypes = {1,3}; // Instance, Associator + ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; +}; + +// Provider registration for OMC_LinuxFileIdentity +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_LinuxFileIdentity:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_LinuxFileIdentity"; + ProviderTypes = {1,3}; // Instance, Associator + ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; +}; + +// Provider registration for OMC_LinuxFile +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_LinuxFile:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_LinuxFile"; + ProviderTypes = {1}; // Instance + ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; +}; + +// Provider registration for OMC_LinuxDataFile +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_LinuxDataFile:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_LinuxDataFile"; + ProviderTypes = {1,6}; // Instance, Method + ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; +}; + +// Provider registration for OMC_LinuxDeviceFile +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_LinuxDeviceFile:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_LinuxDeviceFile"; + ProviderTypes = {1}; // Instance + ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; +}; + +// Provider registration for OMC_LinuxDirectory +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_LinuxDirectory:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_LinuxDirectory"; + ProviderTypes = {1}; // Instance + ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; +}; + +// Provider registration for OMC_LinuxFIFOPipeFile +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_LinuxFIFOPipeFile:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_LinuxFIFOPipeFile"; + ProviderTypes = {1}; // Instance + ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; +}; + +// Provider registration for OMC_LinuxSymbolicLink +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_LinuxSymbolicLink:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_LinuxSymbolicLink"; + ProviderTypes = {1}; // Instance + ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; +}; + + Added: pybase/trunk/OMC_LogicalFile-peg.reg =================================================================== --- pybase/trunk/OMC_LogicalFile-peg.reg (rev 0) +++ pybase/trunk/OMC_LogicalFile-peg.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -0,0 +1,98 @@ +//////// OMC_LogicalFile +instance of PG_ProviderModule +{ + Name = "/usr/lib/pycim/OMC_LogicalFile.py"; + InterfaceType = "Python"; + InterfaceVersion = "1.0.0"; + Location = "/usr/lib/pycim/OMC_LogicalFile.py"; + Vendor = "OMC"; + Version = "0.1.0"; +}; + +instance of PG_Provider +{ + Name = "OMC_LogicalFile"; + ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_LinuxDirectoryContainsFile"; + ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; + ProviderName = "OMC_LogicalFile"; + ClassName = "OMC_LinuxDirectoryContainsFile"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Association +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_LinuxFileIdentity"; + ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; + ProviderName = "OMC_LogicalFile"; + ClassName = "OMC_LinuxFileIdentity"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Association +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_LinuxFile"; + ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; + ProviderName = "OMC_LogicalFile"; + ClassName = "OMC_LinuxFile"; + Namespaces = {"root/cimv2"}; + ProviderType = {2}; // Instance +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_LinuxDataFile"; + ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; + ProviderName = "OMC_LogicalFile"; + ClassName = "OMC_LinuxDataFile"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,5}; // Instance, Method +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_LinuxDeviceFile"; + ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; + ProviderName = "OMC_LogicalFile"; + ClassName = "OMC_LinuxDeviceFile"; + Namespaces = {"root/cimv2"}; + ProviderType = {2}; // Instance +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_LinuxDirectory"; + ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; + ProviderName = "OMC_LogicalFile"; + ClassName = "OMC_LinuxDirectory"; + Namespaces = {"root/cimv2"}; + ProviderType = {2}; // Instance +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_LinuxFIFOPipeFile"; + ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; + ProviderName = "OMC_LogicalFile"; + ClassName = "OMC_LinuxFIFOPipeFile"; + Namespaces = {"root/cimv2"}; + ProviderType = {2}; // Instance +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_LinuxSymbolicLink"; + ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; + ProviderName = "OMC_LogicalFile"; + ClassName = "OMC_LinuxSymbolicLink"; + Namespaces = {"root/cimv2"}; + ProviderType = {2}; // Instance +}; + + Deleted: pybase/trunk/OMC_LogicalFile.reg =================================================================== --- pybase/trunk/OMC_LogicalFile.reg 2007-10-06 17:09:06 UTC (rev 502) +++ pybase/trunk/OMC_LogicalFile.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -1,82 +0,0 @@ - -// Provider registration for OMC_LinuxDirectoryContainsFile -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_LinuxDirectoryContainsFile:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_LinuxDirectoryContainsFile"; - ProviderTypes = {1,3}; // Instance, Associator - ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; -}; - -// Provider registration for OMC_LinuxFileIdentity -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_LinuxFileIdentity:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_LinuxFileIdentity"; - ProviderTypes = {1,3}; // Instance, Associator - ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; -}; - -// Provider registration for OMC_LinuxFile -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_LinuxFile:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_LinuxFile"; - ProviderTypes = {1}; // Instance - ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; -}; - -// Provider registration for OMC_LinuxDataFile -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_LinuxDataFile:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_LinuxDataFile"; - ProviderTypes = {1,6}; // Instance, Method - ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; -}; - -// Provider registration for OMC_LinuxDeviceFile -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_LinuxDeviceFile:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_LinuxDeviceFile"; - ProviderTypes = {1}; // Instance - ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; -}; - -// Provider registration for OMC_LinuxDirectory -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_LinuxDirectory:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_LinuxDirectory"; - ProviderTypes = {1}; // Instance - ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; -}; - -// Provider registration for OMC_LinuxFIFOPipeFile -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_LinuxFIFOPipeFile:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_LinuxFIFOPipeFile"; - ProviderTypes = {1}; // Instance - ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; -}; - -// Provider registration for OMC_LinuxSymbolicLink -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_LinuxSymbolicLink:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_LinuxSymbolicLink"; - ProviderTypes = {1}; // Instance - ModulePath = "/usr/lib/pycim/OMC_LogicalFile.py"; -}; - - Added: pybase/trunk/OMC_OperatingSystem-ow.reg =================================================================== --- pybase/trunk/OMC_OperatingSystem-ow.reg (rev 0) +++ pybase/trunk/OMC_OperatingSystem-ow.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -0,0 +1,29 @@ +// Provider registration for OMC_OperatingSystem +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_OperatingSystem:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_OperatingSystem"; + ProviderTypes = {1,6}; // Instance, Method + ModulePath = "/usr/lib/pycim/OMC_OperatingSystem.py"; +}; + +// Provider registration for OMC_InstalledOS +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_InstalledOS:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_InstalledOS"; + ProviderTypes = {1,3}; // Instance, Associator + ModulePath = "/usr/lib/pycim/OMC_OperatingSystem.py"; +}; + +// Provider registration for OMC_InstalledOS +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_RunningOS:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_RunningOS"; + ProviderTypes = {1,3}; // Instance, Associator + ModulePath = "/usr/lib/pycim/OMC_OperatingSystem.py"; +}; Added: pybase/trunk/OMC_OperatingSystem-peg.reg =================================================================== --- pybase/trunk/OMC_OperatingSystem-peg.reg (rev 0) +++ pybase/trunk/OMC_OperatingSystem-peg.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -0,0 +1,47 @@ +//////// OMC_OperatingSystem +instance of PG_ProviderModule +{ + Name = "/usr/lib/pycim/OMC_OperatingSystem.py"; + InterfaceType = "Python"; + InterfaceVersion = "1.0.0"; + Location = "/usr/lib/pycim/OMC_OperatingSystem.py"; + Vendor = "OMC"; + Version = "0.1.0"; +}; + +instance of PG_Provider +{ + Name = "OMC_OperatingSystem"; + ProviderModuleName = "/usr/lib/pycim/OMC_OperatingSystem.py"; +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_OperatingSystem"; + ProviderModuleName = "/usr/lib/pycim/OMC_OperatingSystem.py"; + ProviderName = "OMC_OperatingSystem"; + ClassName = "OMC_OperatingSystem"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,5}; // Instance, Method +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_InstalledOS"; + ProviderModuleName = "/usr/lib/pycim/OMC_OperatingSystem.py"; + ProviderName = "OMC_OperatingSystem"; + ClassName = "OMC_InstalledOS"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Association +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_RunningOS"; + ProviderModuleName = "/usr/lib/pycim/OMC_OperatingSystem.py"; + ProviderName = "OMC_OperatingSystem"; + ClassName = "OMC_RunningOS"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Association +}; + Deleted: pybase/trunk/OMC_OperatingSystem.reg =================================================================== --- pybase/trunk/OMC_OperatingSystem.reg 2007-10-06 17:09:06 UTC (rev 502) +++ pybase/trunk/OMC_OperatingSystem.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -1,29 +0,0 @@ -// Provider registration for OMC_OperatingSystem -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_OperatingSystem:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_OperatingSystem"; - ProviderTypes = {1,6}; // Instance, Method - ModulePath = "/usr/lib/pycim/OMC_OperatingSystem.py"; -}; - -// Provider registration for OMC_InstalledOS -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_InstalledOS:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_InstalledOS"; - ProviderTypes = {1,3}; // Instance, Associator - ModulePath = "/usr/lib/pycim/OMC_OperatingSystem.py"; -}; - -// Provider registration for OMC_InstalledOS -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_RunningOS:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_RunningOS"; - ProviderTypes = {1,3}; // Instance, Associator - ModulePath = "/usr/lib/pycim/OMC_OperatingSystem.py"; -}; Added: pybase/trunk/OMC_UnitaryComputerSystem-ow.reg =================================================================== --- pybase/trunk/OMC_UnitaryComputerSystem-ow.reg (rev 0) +++ pybase/trunk/OMC_UnitaryComputerSystem-ow.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -0,0 +1,9 @@ +// Provider registration for OMC_UnitaryComputerSystem +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_UnitaryComputerSystem:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_UnitaryComputerSystem"; + ProviderTypes = {1,6}; // Instance, Method + ModulePath = "/usr/lib/pycim/OMC_UnitaryComputerSystem.py"; +}; Added: pybase/trunk/OMC_UnitaryComputerSystem-peg.reg =================================================================== --- pybase/trunk/OMC_UnitaryComputerSystem-peg.reg (rev 0) +++ pybase/trunk/OMC_UnitaryComputerSystem-peg.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -0,0 +1,28 @@ +//////// OMC_UnitaryComputerSystem +instance of PG_ProviderModule +{ + Name = "/usr/lib/pycim/OMC_UnitaryComputerSystem.py"; + InterfaceType = "Python"; + InterfaceVersion = "1.0.0"; + Location = "/usr/lib/pycim/OMC_UnitaryComputerSystem.py"; + Vendor = "OMC"; + Version = "0.1.0"; +}; + +instance of PG_Provider +{ + Name = "OMC_UnitaryComputerSystem"; + ProviderModuleName = "/usr/lib/pycim/OMC_UnitaryComputerSystem.py"; +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_UnitaryComputerSystem"; + ProviderModuleName = "/usr/lib/pycim/OMC_UnitaryComputerSystem.py"; + ProviderName = "OMC_UnitaryComputerSystem"; + ClassName = "OMC_UnitaryComputerSystem"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,5}; // Instance, Method +}; + + Deleted: pybase/trunk/OMC_UnitaryComputerSystem.reg =================================================================== --- pybase/trunk/OMC_UnitaryComputerSystem.reg 2007-10-06 17:09:06 UTC (rev 502) +++ pybase/trunk/OMC_UnitaryComputerSystem.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -1,9 +0,0 @@ -// Provider registration for OMC_UnitaryComputerSystem -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_UnitaryComputerSystem:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_UnitaryComputerSystem"; - ProviderTypes = {1,6}; // Instance, Method - ModulePath = "/usr/lib/pycim/OMC_UnitaryComputerSystem.py"; -}; Added: pybase/trunk/OMC_UnixProcess-ow.reg =================================================================== --- pybase/trunk/OMC_UnixProcess-ow.reg (rev 0) +++ pybase/trunk/OMC_UnixProcess-ow.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -0,0 +1,30 @@ +// Provider registration for OMC_UnixProcess +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_UnixProcess:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_UnixProcess"; + ProviderTypes = {1,6}; // Instance, Method + ModulePath = "/usr/lib/pycim/OMC_UnixProcess.py"; +}; + +// Provider registration for OMC_ProcessExecutable +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_ProcessExecutable:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_ProcessExecutable"; + ProviderTypes = {1,3}; // Instance, Associator + ModulePath = "/usr/lib/pycim/OMC_UnixProcess.py"; +}; + +// Provider registration for OMC_OSProcess +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_OSProcess:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_OSProcess"; + ProviderTypes = {1,3}; // Instance, Associator + ModulePath = "/usr/lib/pycim/OMC_UnixProcess.py"; +}; + Added: pybase/trunk/OMC_UnixProcess-peg.reg =================================================================== --- pybase/trunk/OMC_UnixProcess-peg.reg (rev 0) +++ pybase/trunk/OMC_UnixProcess-peg.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -0,0 +1,48 @@ +//////// OMC_UnixProcess +instance of PG_ProviderModule +{ + Name = "/usr/lib/pycim/OMC_UnixProcess.py"; + InterfaceType = "Python"; + InterfaceVersion = "1.0.0"; + Location = "/usr/lib/pycim/OMC_UnixProcess.py"; + Vendor = "OMC"; + Version = "0.1.0"; +}; + +instance of PG_Provider +{ + Name = "OMC_UnixProcess"; + ProviderModuleName = "/usr/lib/pycim/OMC_UnixProcess.py"; +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_UnixProcess"; + ProviderModuleName = "/usr/lib/pycim/OMC_UnixProcess.py"; + ProviderName = "OMC_UnixProcess"; + ClassName = "OMC_UnixProcess"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,5}; // Instance, Method +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_ProcessExecutable"; + ProviderModuleName = "/usr/lib/pycim/OMC_UnixProcess.py"; + ProviderName = "OMC_UnixProcess"; + ClassName = "OMC_ProcessExecutable"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Association +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_OSProcess"; + ProviderModuleName = "/usr/lib/pycim/OMC_UnixProcess.py"; + ProviderName = "OMC_UnixProcess"; + ClassName = "OMC_OSProcess"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Association +}; + + Deleted: pybase/trunk/OMC_UnixProcess.reg =================================================================== --- pybase/trunk/OMC_UnixProcess.reg 2007-10-06 17:09:06 UTC (rev 502) +++ pybase/trunk/OMC_UnixProcess.reg 2007-11-27 00:20:59 UTC (rev 503) @@ -1,30 +0,0 @@ -// Provider registration for OMC_UnixProcess -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_UnixProcess:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_UnixProcess"; - ProviderTypes = {1,6}; // Instance, Method - ModulePath = "/usr/lib/pycim/OMC_UnixProcess.py"; -}; - -// Provider registration for OMC_ProcessExecutable -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_ProcessExecutable:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_ProcessExecutable"; - ProviderTypes = {1,3}; // Instance, Associator - ModulePath = "/usr/lib/pycim/OMC_UnixProcess.py"; -}; - -// Provider registration for OMC_OSProcess -instance of OpenWBEM_PyProviderRegistration -{ - InstanceID = "OMC:OMC_OSProcess:01"; - NamespaceNames = {"root/cimv2"}; - ClassName = "OMC_OSProcess"; - ProviderTypes = {1,3}; // Instance, Associator - ModulePath = "/usr/lib/pycim/OMC_UnixProcess.py"; -}; - Modified: pybase/trunk/omc-pybase-providers.spec =================================================================== --- pybase/trunk/omc-pybase-providers.spec 2007-10-06 17:09:06 UTC (rev 502) +++ pybase/trunk/omc-pybase-providers.spec 2007-11-27 00:20:59 UTC (rev 503) @@ -21,7 +21,7 @@ BuildArch: noarch Source0: %{name}-%{version}.tar.gz PreReq: /usr/bin/loadmof.sh -Requires: python-pywbem openwbem openwbem-python-providerifc +Requires: python-pywbem pyprovifc>=1.0.0 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -61,7 +61,12 @@ %post loadmof.sh -n root/cimv2 /usr/share/mof/%{name}/OMC_Base.mof -loadmof.sh -n Interop /usr/share/mof/%{name}/*.reg +if [ -x /usr/bin/peg-loadmof.sh ]; then + /usr/bin/peg-loadmof.sh -n root/PG_InterOp /usr/share/mof/%{name}/*-peg.reg +fi +if [ -x /usr/bin/ow-loadmof.sh ]; then + /usr/bin/ow-loadmof.sh -n Interop /usr/share/mof/%{name}/*-ow.reg +fi %changelog -n omc-pybase-providers * Tue May 15 2007 - bwh...@su... Modified: pybase/trunk/setup.py =================================================================== --- pybase/trunk/setup.py 2007-10-06 17:09:06 UTC (rev 502) +++ pybase/trunk/setup.py 2007-11-27 00:20:59 UTC (rev 503) @@ -4,8 +4,15 @@ # For example: # python setup.py install --install-lib=/usr/lib/pycim -O1 +import os from distutils.core import setup +manifest = os.path.dirname(os.path.abspath(__file__)) + '/MANIFEST' +if os.path.exists(manifest): + print 'removing existing MANIFEST file' + os.unlink(manifest) + + setup(name='omc-pybase-providers', author='Jon Carey, Bart Whiteley', author_email='jc...@no..., bwh...@su...', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhi...@us...> - 2007-10-06 17:09:03
|
Revision: 502 http://omc.svn.sourceforge.net/omc/?rev=502&view=rev Author: dhiltgen Date: 2007-10-06 10:09:06 -0700 (Sat, 06 Oct 2007) Log Message: ----------- Add CMPI C++ wrapper patch Modified Paths: -------------- base/branches/cmpi/README Added Paths: ----------- base/branches/cmpi/cmpi-devel-1.0.4.patch Modified: base/branches/cmpi/README =================================================================== --- base/branches/cmpi/README 2007-10-06 00:20:22 UTC (rev 501) +++ base/branches/cmpi/README 2007-10-06 17:09:06 UTC (rev 502) @@ -0,0 +1,3 @@ +In order to build these providers, you must apply cmpi-devel-1.0.4.patch +to the sblim-cmpi-deve-1.0.4 package downloadable from the SBLIM project at +sourceforge. Added: base/branches/cmpi/cmpi-devel-1.0.4.patch =================================================================== --- base/branches/cmpi/cmpi-devel-1.0.4.patch (rev 0) +++ base/branches/cmpi/cmpi-devel-1.0.4.patch 2007-10-06 17:09:06 UTC (rev 502) @@ -0,0 +1,2260 @@ +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiArray.h sblim-cmpi-devel-1.0.4/cmpi/CmpiArray.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiArray.h 2006-01-31 23:59:47.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/CmpiArray.h 2007-10-05 13:44:30.000000000 -0700 +@@ -119,18 +119,18 @@ + friend class CmpiArrayIdx; + friend class CmpiData; + friend class CmpiEnumeration; +- void operator=(int x); + + /** Gets the encapsulated CMPIArray. + */ + CMPIArray *getEnc() const; +- void *makeArray(CMPIBroker *mb,CMPICount max, CMPIType type); + CmpiArray(CMPIArray *arr); + public: + CmpiArray(CMPICount max, CMPIType type); +- CmpiArray(); + CMPICount size() const; + CmpiArrayIdx operator[](int idx) const; ++ bool operator==(const CmpiArray &rval); ++ bool operator!=(const CmpiArray &rval); ++ bool operator<(const CmpiArray &rval); + }; + + #endif +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiBaseMI.h sblim-cmpi-devel-1.0.4/cmpi/CmpiBaseMI.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiBaseMI.h 2006-02-08 04:49:25.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/CmpiBaseMI.h 2007-10-05 13:44:30.000000000 -0700 +@@ -45,10 +45,11 @@ + void setProviderBase(CmpiProviderBase* base); + CmpiProviderBase* getProviderBase(); + +- static CMPIStatus driveBaseCleanup(void* mi, const CMPIContext* eCtx, CMPIBoolean b); ++ static CMPIStatus driveBaseCleanup(void* mi, const CMPIContext* eCtx, ++ CMPIBoolean terminating); + + virtual CmpiStatus initialize(const CmpiContext& ctx); +- virtual CmpiStatus cleanup(CmpiContext& ctx); ++ virtual CmpiStatus cleanup(CmpiContext& ctx, bool terminating); + virtual int isUnloadable() const; + + protected: +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiBroker.h sblim-cmpi-devel-1.0.4/cmpi/CmpiBroker.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiBroker.h 2005-03-18 05:45:39.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/CmpiBroker.h 2007-10-05 13:44:30.000000000 -0700 +@@ -95,7 +95,7 @@ + @return Enumeration of ObjectPathes. + */ + CmpiEnumeration enumInstanceNames +- (const CmpiContext& ctx, const CmpiObjectPath& op); ++ (const CmpiContext& ctx, const CmpiObjectPath& op) const; + + /** Get Instance using <op> as reference. Instance structure can be + controled using the CMPIInvocationFlags entry in <ctx>. +@@ -108,7 +108,7 @@ + */ + CmpiInstance getInstance + (const CmpiContext& ctx, const CmpiObjectPath& op, +- const char** properties); ++ const char** properties) const; + + /** Create Instance from <inst> using <op> as reference. + @param ctx Context object +@@ -160,7 +160,7 @@ + */ + CmpiEnumeration enumInstances + (const CmpiContext& ctx, const CmpiObjectPath& op, +- const char** properties); ++ const char** properties) const; + + /** Enumerate instances associated with the Instance defined by the <op>. + @param ctx Context object +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiData.h sblim-cmpi-devel-1.0.4/cmpi/CmpiData.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiData.h 2006-01-31 07:39:14.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/CmpiData.h 2007-10-05 13:44:30.000000000 -0700 +@@ -58,6 +58,7 @@ + friend class CmpiContext; + friend class CmpiPropertyMI; + friend class CmpiEnumeration; ++ friend class CmpiBroker; + protected: + + /** CmpiData actually is a CMPIData struct. +@@ -68,12 +69,22 @@ + */ + CmpiData(CMPIData& data); + ++ /** Extract the correct CMPIValue* from a CMPIData for use in CMPI ++ calls that take CMPIValue*,CMPIType pairs. E.g. By convention ++ CMPI_chars values are passed as char* cast to CMPIValue*. ++ */ ++ CMPIValue *valPtr() const; ++ + public: + + /** Constructor - Empty constructor. + */ + CmpiData(); + ++ /** Constructor - bool as input. ++ */ ++ CmpiData(bool d); ++ + /** Constructor - singed 8 bit as input. + */ + CmpiData(CMPISint8 d); +@@ -135,6 +146,10 @@ + */ + CmpiData(const CmpiArray& d); + ++ /** Extracting bool. ++ */ ++ operator bool() const; ++ + /** Extracting String. + */ + operator CmpiString() const; +@@ -205,6 +220,10 @@ + /** test for not found value + */ + int isNotFound() const; ++ ++ bool operator==(const CmpiData &rval); ++ bool operator!=(const CmpiData &rval); ++ bool operator<(const CmpiData &rval); + }; + + #endif +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiDateTime.h sblim-cmpi-devel-1.0.4/cmpi/CmpiDateTime.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiDateTime.h 2005-03-18 05:45:40.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/CmpiDateTime.h 2007-10-05 13:44:30.000000000 -0700 +@@ -24,12 +24,9 @@ + #define _CmpiDateTime_h_ + + #include "cmpidt.h" +-#include "cmpift.h" + + #include "Linkage.h" + #include "CmpiObject.h" +-#include "CmpiStatus.h" +-#include "CmpiBaseMI.h" + + + /** This class represents the instance of a CIM DateTime artifact. +@@ -37,35 +34,47 @@ + + class CMPI_PROVIDER_LINKAGE CmpiDateTime : public CmpiObject { + +-protected: +- void *makeDateTime(CMPIBroker *mb); +- void *makeDateTime(CMPIBroker *mb, const char* utcTime); +- void *makeDateTime(CMPIBroker *mb, const CMPIUint64 binTime, +- const CmpiBoolean interval); + private: +-public: ++ ++ /** Constructor - initialize with NULL value. private during ++ * introduction of Now. */ ++ CmpiDateTime(); + + /** Constructor from CMPI type + */ + CmpiDateTime(const CMPIDateTime* enc); + +- /** Constructor - Return current time and date. +- */ +- CmpiDateTime(); ++ friend class CmpiData; + +- CmpiDateTime(const CmpiDateTime& original); ++public: ++ ++ /** Return the unknown time value ++ */ ++ static CmpiDateTime Unknown(); ++ ++ /** Return the current time ++ */ ++ static CmpiDateTime Now(); + + /** Constructor - Initialize time and date according to <utcTime>. + @param utcTime Date/Time definition in UTC format + */ + CmpiDateTime(const char* utcTime); + ++ /** Tag enum ++ */ ++ enum Type { DATE, INTERVAL }; ++ + /** Constructor - Initialize time and date according to <binTime>. + @param binTime Date/Time definition in binary format in microsecods + starting since 00:00:00 GMT, Jan 1,1970. +- @param interval defines Date/Time definition to be an interval value ++ @param type selects date (absolute) or interval (duration) + */ +- CmpiDateTime(const CMPIUint64 binTime, const CmpiBoolean interval); ++ CmpiDateTime(const CMPIUint64 binTime, Type type); ++ ++ /** XXX deprecated ++ */ ++ CmpiDateTime(const CMPIUint64 binTime, CmpiBoolean interval); + + /** isInterval - Tests whether time is an interval value. + @return CmpiBoolean true when time is an interval value. +@@ -81,6 +90,10 @@ + /** Gets the encapsulated CMPIDateTime. + */ + CMPIDateTime *getEnc() const; ++ ++ bool operator==(const CmpiDateTime &rval); ++ bool operator!=(const CmpiDateTime &rval); ++ bool operator<(const CmpiDateTime &rval); + }; + + #endif +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/cmpift.h sblim-cmpi-devel-1.0.4/cmpi/cmpift.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/cmpift.h 2006-01-31 07:39:14.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/cmpift.h 2007-10-05 13:44:30.000000000 -0700 +@@ -723,6 +723,12 @@ + */ + CMPIStatus (*addEntry) + (const CMPIContext* ctx, const char *name, const CMPIValue* value, CMPIType type); ++#if (1 || __VMWARE__) ++ /* free memory used by native objects in this context ++ */ ++ // XXX ++ CMPIStatus (*flush) (CMPIContext* ctx); ++#endif + }; + + +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiIndicationMI.h sblim-cmpi-devel-1.0.4/cmpi/CmpiIndicationMI.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiIndicationMI.h 2005-12-09 09:32:48.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/CmpiIndicationMI.h 2007-10-05 13:44:30.000000000 -0700 +@@ -42,38 +42,38 @@ + CmpiIndicationMI(const CmpiBroker &mbp, const CmpiContext& ctx); + + static CMPIStatus driveAuthorizeFilter +- (CMPIIndicationMI* mi, const CMPIContext* eCtx, const CMPIResult* eRslt, ++ (CMPIIndicationMI* mi, const CMPIContext* eCtx, + const CMPISelectExp* se, const char* ns, const CMPIObjectPath* op, + const char* user); + static CMPIStatus driveMustPoll +- (CMPIIndicationMI* mi, const CMPIContext* eCtx, const CMPIResult* eRrslt, ++ (CMPIIndicationMI* mi, const CMPIContext* eCtx, + const CMPISelectExp* se, const char* ns, const CMPIObjectPath* op); + static CMPIStatus driveActivateFilter +- (CMPIIndicationMI* mi, const CMPIContext* eCtx, const CMPIResult* eRslt, ++ (CMPIIndicationMI* mi, const CMPIContext* eCtx, + const CMPISelectExp* se, const char* ns, const CMPIObjectPath* op, + CMPIBoolean first); + static CMPIStatus driveDeActivateFilter +- (CMPIIndicationMI* mi, const CMPIContext* eCtx, const CMPIResult* eRslt, ++ (CMPIIndicationMI* mi, const CMPIContext* eCtx, + const CMPISelectExp* se, const char* ns, + const CMPIObjectPath* op, CMPIBoolean last); + static void driveEnableIndications +- (CMPIIndicationMI* mi); ++ (CMPIIndicationMI* mi, const CMPIContext* eCtx); + static void driveDisableIndications +- (CMPIIndicationMI* mi); ++ (CMPIIndicationMI* mi, const CMPIContext* eCtx); + + virtual CmpiStatus authorizeFilter +- (const CmpiContext& ctx, CmpiResult& rslt, ++ (const CmpiContext& ctx, + const CmpiSelectExp& se, const char* ns, const CmpiObjectPath& op, + const char* user); + virtual CmpiStatus mustPoll +- (const CmpiContext& ctx, CmpiResult& rslt, ++ (const CmpiContext& ctx, + const CmpiSelectExp& se, const char* ns, const CmpiObjectPath& op); + virtual CmpiStatus activateFilter +- (const CmpiContext& ctx, CmpiResult& rslt, ++ (const CmpiContext& ctx, + const CmpiSelectExp& se, const char* ns, const CmpiObjectPath& op, + CmpiBoolean first); + virtual CmpiStatus deActivateFilter +- (const CmpiContext& ctx, CmpiResult& rslt, ++ (const CmpiContext& ctx, + const CmpiSelectExp& se, const char* ns, const CmpiObjectPath& op, + CmpiBoolean last); + virtual void enableIndications(); +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiInstance.h sblim-cmpi-devel-1.0.4/cmpi/CmpiInstance.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiInstance.h 2005-03-18 05:45:40.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/CmpiInstance.h 2007-10-05 13:44:30.000000000 -0700 +@@ -65,7 +65,7 @@ + */ + void *makeInstance(CMPIBroker *mb, const CmpiObjectPath& cop); + +- CmpiBoolean doInstanceIsA(CMPIBroker *mb, const char *className); ++ CmpiBoolean doInstanceIsA(CMPIBroker *mb, const char *className) const; + + public: + /** Constructor - Creates an Instance object with the classname +@@ -79,13 +79,13 @@ + @param className CIM classname to be tested for. + @return True or False + */ +- CmpiBoolean instanceIsA(const char *className); ++ CmpiBoolean instanceIsA(const char *className) const; + + /** getPropertyCount - Gets the number of Properties + defined for this Instance. + @return Number of Properties of this instance. + */ +- unsigned int getPropertyCount(); ++ unsigned int getPropertyCount() const; + + /** getProperty - Gets the CmpiData object representing the value + associated with the property name +@@ -100,14 +100,14 @@ + @param name Optional output parameter returning the property name. + @return CmpiData value object corresponding to the index. + */ +- CmpiData getProperty(const int index, CmpiString *name=NULL); ++ CmpiData getProperty(const int index, CmpiString *name=NULL) const; + + /** setProperty - adds/replaces a property value defined by the input + parameter to the Instance + @param name Property name. + @param data Type and Value to be added. + */ +- void setProperty(const char* name, const CmpiData data); ++ void setProperty(const char* name, const CmpiData& data); + + /** setPropertyFilter - specifies the list of properties that is accepted + for setProperty operestions. +@@ -122,6 +122,21 @@ + @return the generated ObjectPath. + */ + CmpiObjectPath getObjectPath() const; ++ ++ /** copyInstance - copy all properties from the specified instance. ++ @param instance with properties to copy ++ */ ++ void copyInstance(const CmpiInstance &inst); ++ ++ /** copyKeys - copy all keys from the specified object path. ++ @param object path with keys to copy ++ */ ++ void copyKeys(const CmpiObjectPath &cop); ++ ++ // Only validates object path, not non-key properties ++ bool operator==(const CmpiInstance &cmp) const; ++ bool operator!=(const CmpiInstance &cmp) const; ++ bool operator<(const CmpiInstance &cmp) const; + }; + + #endif +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/cmpimacs.h sblim-cmpi-devel-1.0.4/cmpi/cmpimacs.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/cmpimacs.h 2006-02-09 01:36:32.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/cmpimacs.h 2007-10-05 13:44:30.000000000 -0700 +@@ -2098,6 +2098,7 @@ + #define CMInstanceMIFactory(cn,pn) \ + CMPI_EXTERN_C \ + CMPIInstanceMI* pn##_Create_InstanceMI(const CMPIBroker* broker, const CMPIContext *ctxp, CMPIStatus *rc) { \ ++ (void)rc; \ + static CMPIInstanceMIFT instMIFT={ \ + CMPICurrentVersion, \ + CMPICurrentVersion, \ +@@ -2112,7 +2113,6 @@ + CmpiInstanceMI::driveExecQuery, \ + }; \ + static CMPIInstanceMI mi; \ +- fprintf(stderr,"--- _Create_InstanceMI() broker: %p\n",broker); \ + CmpiContext ctx((CMPIContext*)ctxp); \ + mi.ft=&instMIFT; \ + CmpiBaseMI *provider=base##pn.getBaseMI(); \ +@@ -2122,6 +2122,7 @@ + provider->initialize(ctx); \ + base##pn.setBaseMI(provider); \ + } \ ++ fprintf(stderr,"--- _Create_InstanceMI() %s\n", typeid(provider).name()); \ + mi.hdl=provider; \ + base##pn.incUseCount(); \ + return &mi; \ +@@ -2146,6 +2147,7 @@ + #define CMAssociationMIFactory(cn,pn) \ + CMPI_EXTERN_C \ + CMPIAssociationMI* pn##_Create_AssociationMI(const CMPIBroker* broker, const CMPIContext *ctxp, CMPIStatus *rc) { \ ++ (void)rc; \ + static CMPIAssociationMIFT assocMIFT={ \ + CMPICurrentVersion, \ + CMPICurrentVersion, \ +@@ -2191,6 +2193,7 @@ + #define CMMethodMIFactory(cn,pn) \ + CMPI_EXTERN_C \ + CMPIMethodMI* pn##_Create_MethodMI(const CMPIBroker* broker, const CMPIContext *ctxp, CMPIStatus *rc) { \ ++ (void)rc; \ + static CMPIMethodMIFT methMIFT={ \ + CMPICurrentVersion, \ + CMPICurrentVersion, \ +@@ -2232,6 +2235,7 @@ + #define CMPropertyMIFactory(cn,pn) \ + CMPI_EXTERN_C \ + CMPIMethodMI* pn##_Create_PropertyMI(const CMPIBroker* broker, const CMPIContext *ctxp, CMPIStatus *rc) { \ ++ (void)rc; \ + static CMPIPropertyMIFT propMIFT={ \ + CMPICurrentVersion, \ + CMPICurrentVersion, \ +@@ -2283,6 +2287,7 @@ + #define CMIndicationMIFactory(cn,pn) \ + CMPI_EXTERN_C \ + CMPIIndicationMI* pn##_Create_IndicationMI(const CMPIBroker* broker, const CMPIContext *ctxp, CMPIStatus *rc) { \ ++ (void)rc; \ + static CMPIIndicationMIFT indMIFT={ \ + CMPICurrentVersion, \ + CMPICurrentVersion, \ +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiObject.h sblim-cmpi-devel-1.0.4/cmpi/CmpiObject.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiObject.h 2005-03-18 05:45:40.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/CmpiObject.h 2007-10-05 13:44:30.000000000 -0700 +@@ -55,7 +55,7 @@ + */ + CmpiObject(const void* enc); + +- CmpiString doToString(CMPIBroker *mb); ++ CmpiString doToString(CMPIBroker *mb) const; + + CmpiBoolean doIsA(CMPIBroker *mb, const char *typeName) const; + private: +@@ -66,7 +66,7 @@ + + /** toString - Produces CIMOM specific string representation of object + */ +- CmpiString toString(); ++ CmpiString toString() const; + + /** isA - checks this objects type ; + */ +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiObjectPath.h sblim-cmpi-devel-1.0.4/cmpi/CmpiObjectPath.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiObjectPath.h 2005-03-18 05:45:40.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/CmpiObjectPath.h 2007-10-05 13:44:30.000000000 -0700 +@@ -147,7 +147,11 @@ + @param name key name. + @param data Type and Value to be added. + */ +- void setKey(const char* name, const CmpiData data); ++ void setKey(const char* name, const CmpiData& data); ++ ++ bool operator==(const CmpiObjectPath &cmp) const; ++ bool operator!=(const CmpiObjectPath &cmp) const; ++ bool operator<(const CmpiObjectPath &cmp) const; + }; + + #endif +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiResult.h sblim-cmpi-devel-1.0.4/cmpi/CmpiResult.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiResult.h 2005-03-18 05:45:40.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/CmpiResult.h 2007-10-05 13:44:30.000000000 -0700 +@@ -3,6 +3,7 @@ + * $Id: CmpiResult.h,v 1.1.1.1 2005/03/18 13:45:40 mihajlov Exp $ + * + * (C) Copyright IBM Corp. 2003, 2005 ++ * Copyright (c) 2007 VMware, Inc. All rights reserved. + * + * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE + * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE +@@ -33,6 +34,147 @@ + #include "CmpiInstance.h" + #include "CmpiObjectPath.h" + ++#if (1 || __VMWARE__) ++struct CmpiPushFilter; ++class CmpiResult; ++class CmpiInstanceMI; ++#endif ++ ++/** ++ * Abstract result filter for post-processing results before returning to ++ * the CIMOM. ++ * ++ */ ++class CMPI_PROVIDER_LINKAGE CmpiResultFilter { ++ friend class CmpiResult; ++ friend struct CmpiPushFilter; ++ ++public: ++ CmpiResultFilter(); ++ virtual ~CmpiResultFilter(); ++ virtual void returnData(const CmpiData& d) = 0; ++ virtual void returnData(const CmpiInstance& d) = 0; ++ virtual void returnData(const CmpiObjectPath& d) = 0; ++ virtual void returnDone() = 0; ++ ++private: ++ /* ++ * Filters can be linked in a chain. The CmpiResult will manage sending ++ * data from one filter to the next using nextFilter. ++ */ ++ CmpiResultFilter *nextFilter; ++}; ++ ++/** ++ * Stack based result filter for post-processing results before returning to ++ * the CIMOM. ++ * ++ */ ++class CMPI_PROVIDER_LINKAGE CmpiScopedResultFilter : public CmpiResultFilter { ++public: ++ CmpiScopedResultFilter(CmpiResult &rslt); ++ virtual ~CmpiScopedResultFilter(); ++ virtual void returnData(const CmpiData& d); ++ virtual void returnData(const CmpiInstance& d); ++ virtual void returnData(const CmpiObjectPath& d); ++ virtual void returnDone(); ++ ++protected: ++ ++ /** The CmpiResult to deliver the data to once processing has completed ++ */ ++ CmpiResult &result; ++ ++}; ++ ++/** ++ * Filter to discard returnDone calls so that multiple result sets ++ * can be returned at once. For example, this filter may be useful ++ * to call enumerateInstances for multiple classes. Once this ++ * filter leaves scope, returnDone should be called on the CmpiResult ++ * to signal that there is no more data to return to the client. ++ */ ++class CMPI_PROVIDER_LINKAGE CmpiResultDiscardDoneFilter : ++ public CmpiScopedResultFilter { ++public: ++ CmpiResultDiscardDoneFilter(CmpiResult &rslt); ++ virtual ~CmpiResultDiscardDoneFilter(); ++ virtual void returnDone(); ++}; ++ ++/** ++ * General purpose Instance to ObjectPath filter ++ * Any Instances returned through this filter will be converted into ++ * ObjectPaths, such that methods like enumInstanceNames can be ++ * implemented by a call to enumInstances. ++ */ ++class CMPI_PROVIDER_LINKAGE CmpiResultInstanceToPathFilter : ++ public CmpiScopedResultFilter { ++public: ++ CmpiResultInstanceToPathFilter(CmpiResult &rslt); ++ virtual void returnData(const CmpiInstance& d); ++}; ++ ++/** ++ * General purpose ObjectPath to Instance filter ++ * Any ObjectPaths returned through this filter will be converted into ++ * Instances by a call to getInstance, such that methods like ++ * enumInstances can be implemented by a call to enumInstanceNames. ++ * ++ * ReturnDone is filtered, and will be called when this filer leaves ++ * scope. ++ */ ++class CMPI_PROVIDER_LINKAGE CmpiResultPathToInstanceFilter : ++ public CmpiScopedResultFilter { ++public: ++ CmpiResultPathToInstanceFilter(CmpiResult &rslt, ++ const CmpiContext &ctx, ++ const char **properties, ++ CmpiInstanceMI *provider); ++ virtual ~CmpiResultPathToInstanceFilter(); ++ virtual void returnData(const CmpiObjectPath& d); ++ virtual void returnDone(); ++ ++private: ++ const CmpiContext &ctx; ++ const char **properties; ++ CmpiInstanceMI *provider; ++}; ++ ++/** ++ * General purpose References result filter. ++ * This filter will generate association instances given an ++ * input object path and the object paths passed into the result ++ */ ++class CMPI_PROVIDER_LINKAGE CmpiResultReferencesFilter : ++ public CmpiScopedResultFilter { ++public: ++ CmpiResultReferencesFilter(CmpiResult &rslt, ++ const CmpiObjectPath &sourcePath, ++ const char *destNamespace, ++ const char *assocClassname, ++ const char *sourceProp, ++ const char *destProp); ++ virtual ~CmpiResultReferencesFilter(); ++ virtual void returnData(const CmpiData& d); ++ virtual void returnData(const CmpiInstance& d); ++ virtual void returnData(const CmpiObjectPath& d); ++ /** Flip the source and destination for processing */ ++ virtual void flipRoles(); ++ /** Generate the next association instance prior to calling returnData ++ * This may be used to add non-reference properties to an association ++ */ ++ virtual CmpiInstance *generateNextInstance(); ++ ++private: ++ const CmpiObjectPath &sourcePath; ++ const char *destNamespace; ++ const char *assocClassname; ++ const char *sourceProp; ++ const char *destProp; ++ CmpiInstance *nextAssociation; ++ ++}; + + /** This class acts as a container to hold values returned by provider functions. + */ +@@ -48,6 +190,23 @@ + /** Constructor - Should not be called + */ + CmpiResult(); ++ ++ /** dtor ++ */ ++ ~CmpiResult(); ++ ++ /** The current filter to pass results to. ++ */ ++ CmpiResultFilter *currentFilter; ++ ++ /** Non zero when filtering is taking place ++ */ ++ CMPIUint16 activeFilter; ++ ++ /** number of items returned ++ */ ++ CMPIUint32 returnCount; ++ + protected: + + /** Protected constructor used by MIDrivers to encapsulate CMPIResult. +@@ -57,6 +216,7 @@ + /** getEnc - Gets the encapsulated CMPIResult. + */ + CMPIResult *getEnc() const; ++ + + public: + +@@ -75,6 +235,15 @@ + /** returnDone - Indicate all data returned. + */ + void returnDone(); ++ ++ /** pushFilter - Install a new filter to process the results ++ */ ++ void pushFilter(CmpiResultFilter *f); ++ ++ /** popFilter - Remove the last filter that was installed. ++ */ ++ void popFilter(); ++ + }; + + #endif +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiStatus.h sblim-cmpi-devel-1.0.4/cmpi/CmpiStatus.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiStatus.h 2005-03-18 05:45:39.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/CmpiStatus.h 2007-10-05 13:44:30.000000000 -0700 +@@ -67,6 +67,12 @@ + */ + CmpiStatus(const CMPIrc rc); + ++ ++ /** Destructor. - ++ virtual: creates vtable which generates rtti for exceptions. ++ */ ++ virtual ~CmpiStatus(); ++ + /** Constructor - set rc and message. + @param rc The return code. + @param msg Descriptive message. +@@ -79,7 +85,7 @@ + + /** msg - get the msg component. + */ +- const char* msg(); ++ const char* msg() const; + }; + + #endif +diff -ur sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiString.h sblim-cmpi-devel-1.0.4/cmpi/CmpiString.h +--- sblim-cmpi-devel-1.0.4-stock/cmpi/CmpiString.h 2005-03-18 05:45:39.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/cmpi/CmpiString.h 2007-10-05 13:44:30.000000000 -0700 +@@ -59,7 +59,7 @@ + void *enc; + /** Constructor - Internal use only + */ +- CmpiString(CMPIString* c); ++ explicit CmpiString(CMPIString* c); + + /** Gets the encapsulated CMPIString. + */ +@@ -71,10 +71,6 @@ + */ + CmpiString(); + +- /** Constructor - Copy constructor +- */ +- CmpiString(const CmpiString& s); +- + /** charPtr - get pointer to char* representation + */ + const char* charPtr() const; +@@ -90,6 +86,16 @@ + CmpiBoolean equalsIgnoreCase(const CmpiString& str) const; + }; + ++bool operator==(const CmpiString &lval, const CmpiString &rval); ++bool operator==(const CmpiString &lval, const char *rval); ++bool operator==(const char *lval, const CmpiString &rval); ++bool operator!=(const CmpiString &lval, const CmpiString &rval); ++bool operator!=(const CmpiString &lval, const char *rval); ++bool operator!=(const char *lval, const CmpiString &rval); ++bool operator<(const CmpiString &lval, const CmpiString &rval); ++bool operator<(const CmpiString &lval, const char *rval); ++bool operator<(const char *lval, const CmpiString &rval); ++ + #endif + + +diff -ur sblim-cmpi-devel-1.0.4-stock/CmpiImpl.cpp sblim-cmpi-devel-1.0.4/CmpiImpl.cpp +--- sblim-cmpi-devel-1.0.4-stock/CmpiImpl.cpp 2006-02-08 04:49:25.000000000 -0800 ++++ sblim-cmpi-devel-1.0.4/CmpiImpl.cpp 2007-10-05 13:44:30.000000000 -0700 +@@ -3,6 +3,7 @@ + * $Id: CmpiImpl.cpp,v 1.5 2006/02/08 12:49:25 mihajlov Exp $ + * + * (C) Copyright IBM Corp. 2003, 2005 ++ * Copyright (c) 2007 VMware, Inc. All rights reserved. + * + * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE + * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE +@@ -39,6 +40,7 @@ + #include "CmpiCharData.h" + #include "CmpiBooleanData.h" + ++ + using namespace std; + + //--------------------------------------------------- +@@ -58,7 +60,7 @@ + } + + CMPIStatus CmpiBaseMI::driveBaseCleanup +- (void* vi, const CMPIContext* eCtx, CMPIBoolean b) { ++ (void* vi, const CMPIContext* eCtx, CMPIBoolean terminating) { + try { + CMPIInstanceMI *mi=( CMPIInstanceMI*)vi; + CmpiContext ctx((CMPIContext*)eCtx); +@@ -68,7 +70,7 @@ + if (cmi->getProviderBase() && cmi->getProviderBase()->decUseCount()==0) { + cmi->getProviderBase()->setBaseMI(0); + cmi->setProviderBase(0); +- rc=cmi->cleanup(ctx); ++ rc=cmi->cleanup(ctx, terminating); + delete cmi; + } + } else { +@@ -76,7 +78,8 @@ + } + return rc.status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + + return stat.status(); + } +@@ -97,8 +100,8 @@ + return CmpiStatus(CMPI_RC_OK); + } + +-CmpiStatus CmpiBaseMI::cleanup(CmpiContext& ctx) { +- cerr << "cleaning up provider" << endl; ++CmpiStatus CmpiBaseMI::cleanup(CmpiContext& ctx, bool terminating) { ++ cerr << "cleaning up provider " << typeid(*this).name() << endl; + return CmpiStatus(CMPI_RC_OK); + } + +@@ -124,7 +127,9 @@ + CmpiInstanceMI* imi = dynamic_cast<CmpiInstanceMI*>(cmi); + return imi->enumInstanceNames(ctx,rslt,cop).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status while processing " ++ << CMGetCharsPtr(CMGetClassName(eCop, NULL), NULL) ++ << " (" << stat.rc() << ") " << stat.msg() << endl; + return stat.status(); + } + } +@@ -142,7 +147,9 @@ + return imi->enumInstances + (ctx,rslt,cop,properties).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status while processing " ++ << CMGetCharsPtr(CMGetClassName(eCop, NULL), NULL) ++ << " (" << stat.rc() << ") " << stat.msg() << endl; + return stat.status(); + } + } +@@ -160,7 +167,9 @@ + return imi->getInstance + (ctx,rslt,cop,properties).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status while processing " ++ << CMGetCharsPtr(CMGetClassName(eCop, NULL), NULL) ++ << " (" << stat.rc() << ") " << stat.msg() << endl; + return stat.status(); + } + } +@@ -179,7 +188,9 @@ + return imi->createInstance + (ctx,rslt,cop,inst).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status while processing " ++ << CMGetCharsPtr(CMGetClassName(eCop, NULL), NULL) ++ << " (" << stat.rc() << ") " << stat.msg() << endl; + return stat.status(); + } + } +@@ -199,7 +210,9 @@ + return imi->setInstance + (ctx,rslt,cop,inst,(const char**)properties).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status while processing " ++ << CMGetCharsPtr(CMGetClassName(eCop, NULL), NULL) ++ << " (" << stat.rc() << ") " << stat.msg() << endl; + return stat.status(); + } + } +@@ -217,7 +230,9 @@ + return imi->deleteInstance + (ctx,rslt,cop).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status while processing " ++ << CMGetCharsPtr(CMGetClassName(eCop, NULL), NULL) ++ << " (" << stat.rc() << ") " << stat.msg() << endl; + return stat.status(); + } + } +@@ -235,7 +250,9 @@ + return imi->execQuery + (ctx,rslt,cop,language,query).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status while processing " ++ << CMGetCharsPtr(CMGetClassName(eCop, NULL), NULL) ++ << " (" << stat.rc() << ") " << stat.msg() << endl; + return stat.status(); + } + } +@@ -313,7 +330,8 @@ + (const char*)assocClass,resultClass, + role,resultRole,(const char**)properties).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + return stat.status(); + } + } +@@ -333,7 +351,8 @@ + assocClass,resultClass, + role,resultRole).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + return stat.status(); + } + } +@@ -352,7 +371,8 @@ + (ctx,rslt,cop, + resultClass,role,(const char**)properties).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + return stat.status(); + } + } +@@ -370,7 +390,8 @@ + (ctx,rslt,cop, + resultClass,role).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + return stat.status(); + } + } +@@ -436,7 +457,8 @@ + return mmi->invokeMethod + (ctx,rslt,cop,methodName,in,out).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + return stat.status(); + } + } +@@ -483,7 +505,9 @@ + return pmi->setProperty + (ctx,rslt,cop,name,data).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() << " " ++ << stat.msg() << " - property name: \"" << name << "\" type: " ++ << eData.type << endl; + return stat.status(); + } + } +@@ -500,7 +524,8 @@ + return pmi->getProperty + (ctx,rslt,cop,name).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + return stat.status(); + } + } +@@ -536,82 +561,82 @@ + } + + CMPIStatus CmpiIndicationMI::driveAuthorizeFilter +- (CMPIIndicationMI* mi, const CMPIContext* eCtx, const CMPIResult* eRslt, ++ (CMPIIndicationMI* mi, const CMPIContext* eCtx, + const CMPISelectExp* eSe, const char* ns, const CMPIObjectPath* eCop, + const char* user){ + try { + const CmpiContext ctx((CMPIContext*)eCtx); +- CmpiResult rslt((CMPIResult*)eRslt); + const CmpiObjectPath cop((CMPIObjectPath*)eCop); + const CmpiSelectExp se(eSe); + CmpiBaseMI* cmi = reinterpret_cast<CmpiBaseMI*> (mi->hdl); + CmpiIndicationMI* nmi = dynamic_cast<CmpiIndicationMI*>(cmi); + return nmi->authorizeFilter +- (ctx,rslt,se,ns,cop,user).status(); ++ (ctx,se,ns,cop,user).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + return stat.status(); + } + } + + CMPIStatus CmpiIndicationMI::driveMustPoll +- (CMPIIndicationMI* mi, const CMPIContext* eCtx, const CMPIResult* eRslt, ++ (CMPIIndicationMI* mi, const CMPIContext* eCtx, + const CMPISelectExp* eSe, const char* ns, const CMPIObjectPath* eCop){ + try { + const CmpiContext ctx((CMPIContext*)eCtx); +- CmpiResult rslt((CMPIResult*)eRslt); + const CmpiObjectPath cop((CMPIObjectPath*)eCop); + const CmpiSelectExp se(eSe); + CmpiBaseMI* cmi = reinterpret_cast<CmpiBaseMI*> (mi->hdl); + CmpiIndicationMI* nmi = dynamic_cast<CmpiIndicationMI*>(cmi); + return nmi->mustPoll +- (ctx,rslt,se,ns,cop).status(); ++ (ctx,se,ns,cop).status(); + } catch (CmpiStatus& stat) { + return stat.status(); +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + } + } + + CMPIStatus CmpiIndicationMI::driveActivateFilter +- (CMPIIndicationMI* mi, const CMPIContext* eCtx, const CMPIResult* eRslt, ++ (CMPIIndicationMI* mi, const CMPIContext* eCtx, + const CMPISelectExp* eSe, const char* ns, const CMPIObjectPath* eCop, + CMPIBoolean first){ + const CmpiContext ctx((CMPIContext*)eCtx); + try { +- CmpiResult rslt((CMPIResult*)eRslt); + const CmpiObjectPath cop((CMPIObjectPath*)eCop); + const CmpiSelectExp se(eSe); + CmpiBaseMI* cmi = reinterpret_cast<CmpiBaseMI*> (mi->hdl); + CmpiIndicationMI* nmi = dynamic_cast<CmpiIndicationMI*>(cmi); + return nmi->activateFilter +- (ctx,rslt,se,ns,cop,first).status(); ++ (ctx,se,ns,cop,first).status(); + } catch (CmpiStatus& stat) { + return stat.status(); +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + } + } + + CMPIStatus CmpiIndicationMI::driveDeActivateFilter +- (CMPIIndicationMI* mi, const CMPIContext* eCtx, const CMPIResult* eRslt, ++ (CMPIIndicationMI* mi, const CMPIContext* eCtx, + const CMPISelectExp* eSe, const char* ns, const CMPIObjectPath* eCop, + const CMPIBoolean last){ + try { + const CmpiContext ctx((CMPIContext*)eCtx); +- CmpiResult rslt((CMPIResult*)eRslt); + const CmpiObjectPath cop((CMPIObjectPath*)eCop); + const CmpiSelectExp se(eSe); + CmpiBaseMI* cmi = reinterpret_cast<CmpiBaseMI*> (mi->hdl); + CmpiIndicationMI* nmi = dynamic_cast<CmpiIndicationMI*>(cmi); + return nmi->deActivateFilter +- (ctx,rslt,se,ns,cop,last).status(); ++ (ctx,se,ns,cop,last).status(); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + return stat.status(); + } + } + + void CmpiIndicationMI::driveEnableIndications +- (CMPIIndicationMI* mi) ++ (CMPIIndicationMI* mi, const CMPIContext* eCtx) + { + try { + CmpiBaseMI* cmi = reinterpret_cast<CmpiBaseMI*> (mi->hdl); +@@ -619,12 +644,13 @@ + return nmi->enableIndications + (); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + } + } + + void CmpiIndicationMI::driveDisableIndications +- (CMPIIndicationMI* mi) ++ (CMPIIndicationMI* mi, const CMPIContext* eCtx) + { + try { + CmpiBaseMI* cmi = reinterpret_cast<CmpiBaseMI*> (mi->hdl); +@@ -632,7 +658,8 @@ + return nmi->disableIndications + (); + } catch (CmpiStatus& stat) { +- cerr << "caught status :" << stat.rc() << " " << stat.msg() << endl; ++ cerr << __PRETTY_FUNCTION__ << "caught status :" << stat.rc() ++ << " " << stat.msg() << endl; + } + } + +@@ -644,26 +671,26 @@ + //--------------------------------------------------- + + CmpiStatus CmpiIndicationMI::authorizeFilter +- (const CmpiContext& ctx, CmpiResult& rslt, ++ (const CmpiContext& ctx, + const CmpiSelectExp& se, const char* ns, const CmpiObjectPath& op, const char* user) { + return CmpiStatus(CMPI_RC_ERR_NOT_SUPPORTED); + } + + CmpiStatus CmpiIndicationMI::mustPoll +- (const CmpiContext& ctx, CmpiResult& rslt, ++ (const CmpiContext& ctx, + const CmpiSelectExp& se, const char* ns, const CmpiObjectPath& op) { + return CmpiStatus(CMPI_RC_ERR_NOT_SUPPORTED); + } + + CmpiStatus CmpiIndicationMI::activateFilter +- (const CmpiContext& ctx, CmpiResult& rslt, ++ (const CmpiContext& ctx, + const CmpiSelectExp& se, const char* ns, const CmpiObjectPath& op, + CMPIBoolean first) { + return CmpiStatus(CMPI_RC_ERR_NOT_SUPPORTED); + } + + CmpiStatus CmpiIndicationMI::deActivateFilter +- (const CmpiContext& ctx, CmpiResult& rslt, ++ (const CmpiContext& ctx, + const CmpiSelectExp& se, const char* ns, const CmpiObjectPath& op, + CMPIBoolean last) { + return CmpiStatus(CMPI_RC_ERR_NOT_SUPPORTED); +@@ -694,26 +721,17 @@ + } + + CmpiArray::CmpiArray(CMPICount max, CMPIType type) { +- enc=makeArray(CmpiProviderBase::getBroker(),max,type); +-} +- +-CmpiArray::CmpiArray() { ++ CMPIBroker* mb = CmpiProviderBase::getBroker(); ++ CMPIStatus rc={CMPI_RC_OK,NULL}; ++ void *array=mb->eft->newArray(mb,max,type,&rc); ++ if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); ++ enc=array; + } + +- void CmpiArray::operator=(int x) { +- } +- + CmpiArrayIdx CmpiArray::operator[](int idx) const { + return CmpiArrayIdx(*this,idx); + } + +-void *CmpiArray::makeArray(CMPIBroker *mb, CMPICount max, CMPIType type) { +- CMPIStatus rc={CMPI_RC_OK,NULL}; +- void *array=mb->eft->newArray(mb,max,type,&rc); +- if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); +- return array; +-} +- + CMPICount CmpiArray::size() const { + CMPIStatus rc={CMPI_RC_OK,NULL}; + CMPICount c=getEnc()?getEnc()->ft->getSize(getEnc(),&rc):0; +@@ -721,6 +739,28 @@ + return c; + } + ++bool CmpiArray::operator==(const CmpiArray &rval) { ++ CMPICount mySize = size(); ++ if (mySize != rval.size()) return false; ++ for (CMPICount i = 0; i < mySize; i++) { ++ if (operator [](i).getData() != rval[i].getData()) return false; ++ } ++ return true; ++} ++bool CmpiArray::operator!=(const CmpiArray &rval) { ++ return (!(*this==rval)); ++} ++ ++bool CmpiArray::operator<(const CmpiArray &rval) { ++ CMPICount mySize = size(); ++ if (mySize != rval.size()) return mySize < rval.size(); ++ for (CMPICount i = 0; i < mySize; i++) { ++ if (operator [](i).getData() != rval[i].getData()) ++ return operator [](i).getData() < rval[i].getData(); ++ } ++ return false; ++} ++ + //--------------------------------------------------- + //-- + // CmpiArrayIdx member functions +@@ -735,15 +775,34 @@ + + CmpiArrayIdx& CmpiArrayIdx::operator=(const CmpiData& v) { + CMPIStatus rc={CMPI_RC_OK,NULL}; +- if (ar.getEnc()->ft->getSimpleType(ar.getEnc(),&rc)!=v._data.type) +- throw CmpiStatus(CMPI_RC_ERR_TYPE_MISMATCH); +- rc=ar.getEnc()->ft->setElementAt(ar.getEnc(),idx,(CMPIValue*)&v._data.value, +- v._data.type); +- if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); ++ CMPIType arrayType = ar.getEnc()->ft->getSimpleType(ar.getEnc(),&rc); ++ if (rc.rc!=CMPI_RC_OK) ++ throw CmpiStatus(rc); ++ arrayType &= ~CMPI_ARRAY; ++ ++ CMPIType valueType = v._data.type; ++ if (arrayType == CMPI_string && ++ CMPI_chars==valueType) // XXX This seems fishy... ++ valueType=CMPI_string; ++ valueType &= ~CMPI_ARRAY; ++ ++ if (arrayType != valueType) { ++ char buf[128]; ++ snprintf(buf, 128, "Type mismatch: 0x%x != 0x%x", arrayType, valueType); ++ throw CmpiStatus(CMPI_RC_ERR_TYPE_MISMATCH, buf); ++ } ++ ++ rc=ar.getEnc()->ft->setElementAt( ++ ar.getEnc(),idx,v.valPtr(),v._data.type); ++ if (rc.rc!=CMPI_RC_OK) { ++ char buf[128]; ++ snprintf(buf, 128, "setElementAt returned an error, possible type mismatch: 0x%x != 0x%x", arrayType, valueType); ++ cerr << buf << endl; ++ throw CmpiStatus(rc); ++ } + return *this; + } + +- + CmpiData CmpiArrayIdx::getData() const{ + CMPIStatus rc={CMPI_RC_OK,NULL}; + CMPIData d; +@@ -823,12 +882,24 @@ + this->_data=data; + } + ++CMPIValue *CmpiData::valPtr() const { ++ // TODO handle null values correctly. ++ return _data.type!=CMPI_chars ? ++ const_cast<CMPIValue*>(&_data.value) : (CMPIValue*)_data.value.chars; ++} ++ + CmpiData::CmpiData() { + _data.state=CMPI_nullValue; + _data.value.uint64=0; + _data.type=CMPI_null; + } + ++CmpiData::CmpiData(bool d) { ++ _data.state=CMPI_goodValue; ++ _data.value.boolean=d; ++ _data.type=CMPI_boolean; ++} ++ + CmpiData::CmpiData(CMPISint8 d) { + _data.state=CMPI_goodValue; + _data.value.sint8=d; +@@ -891,14 +962,20 @@ + + CmpiData::CmpiData(const CmpiString& d) { + _data.state=CMPI_goodValue; +- _data.value.chars=(char*)d.charPtr(); +- _data.type=CMPI_chars; ++ _data.value.string=d.getEnc(); ++ _data.type=CMPI_string; + } + + CmpiData::CmpiData(const char* d) { +- _data.state=CMPI_goodValue; +- _data.value.chars=(char*)d; +- _data.type=CMPI_chars; ++ if (d == NULL) { ++ _data.state=CMPI_nullValue; ++ _data.value.uint64=0; ++ _data.type=CMPI_chars; ++ } else { ++ _data.state=CMPI_goodValue; ++ _data.value.chars=const_cast<char*>(d); ++ _data.type=CMPI_chars; ++ } + } + + CmpiData::CmpiData(const CmpiDateTime& d) { +@@ -913,6 +990,13 @@ + _data.type=((CMPIArrayFT*)d.getEnc()->ft)->getSimpleType(d.getEnc(),0) | CMPI_ARRAY; + } + ++CmpiData::operator bool() const { ++ if (_data.type!=CMPI_boolean) ++ throw CmpiStatus(CMPI_RC_ERR_TYPE_MISMATCH); ++ else ++ return _data.value.boolean; ++} ++ + CmpiData::operator CmpiString() const { + if (_data.type!=CMPI_string) + throw CmpiStatus(CMPI_RC_ERR_TYPE_MISMATCH); +@@ -921,10 +1005,12 @@ + } + + CmpiData::operator const char* () const { +- if (_data.type!=CMPI_string) +- throw CmpiStatus(CMPI_RC_ERR_TYPE_MISMATCH); +- else ++ if (_data.type==CMPI_string) + return CmpiString(_data.value.string).charPtr(); ++ else if (_data.type==CMPI_chars) ++ return _data.value.chars; ++ else ++ throw CmpiStatus(CMPI_RC_ERR_TYPE_MISMATCH); + } + + CmpiData::operator CmpiDateTime() const { +@@ -1039,6 +1125,135 @@ + return (_data.state & CMPI_notFound); + } + ++bool CmpiData::operator==(const CmpiData &rval) { ++ if (_data.type != rval._data.type) return false; ++ if (_data.state != rval._data.state) return false; ++ if (_data.state == CMPI_nullValue ) return true; ++ if (_data.state == CMPI_notFound ) return true; ++ if (_data.state == CMPI_badValue ) return true; ++ if (_data.type & CMPI_ARRAY) ++ return (operator CmpiArray() == rval.operator CmpiArray()); ++ switch (_data.type) { ++ case CMPI_boolean: ++ return (_data.value.boolean == rval._data.value.boolean); ++ case CMPI_char16: ++ return (_data.value.char16 == rval._data.value.char16); ++ case CMPI_real32: ++ return (_data.value.real32 == rval._data.value.real32); ++ case CMPI_real64: ++ return (_data.value.real64 == rval._data.value.real64); ++ case CMPI_uint8: ++ return (_data.value.uint8 == rval._data.value.uint8); ++ case CMPI_uint16: ++ return (_data.value.uint16 == rval._data.value.uint16); ++ case CMPI_uint32: ++ return (_data.value.uint32 == rval._data.value.uint32); ++ case CMPI_uint64: ++ return (_data.value.uint64 == rval._data.value.uint64); ++ case CMPI_sint8: ++ return (_data.value.sint8 == rval._data.value.sint8); ++ case CMPI_sint16: ++ return (_data.value.sint16 == rval._data.value.sint16); ++ case CMPI_sint32: ++ return (_data.value.sint32 == rval._data.value.sint32); ++ case CMPI_sint64: ++ return (_data.value.sint64 == rval._data.value.sint64); ++ case CMPI_ref: ++ if (!_data.value.ref && !rval._data.value.ref) return true; ++ if (!_data.value.ref || !rval._data.value.ref) return false; ++ return (operator CmpiObjectPath() == rval.operator CmpiObjectPath()); ++ case CMPI_string: ++ if (!_data.value.string && !rval._data.value.string) return true; ++ if (!_data.value.string || !rval._data.value.string) return false; ++ return (operator CmpiString() == rval.operator CmpiString()); ++ case CMPI_chars: ++ if (!_data.value.chars && !rval._data.value.chars) return true; ++ if (!_data.value.chars || !rval._data.value.chars) return false; ++ return (strcmp(_data.value.chars,rval._data.value.chars)==0); ++ case CMPI_dateTime: ++ if (!_data.value.dateTime && !rval._data.value.dateTime) return true; ++ if (!_data.value.dateTime || !rval._data.value.dateTime) return false; ++ return (operator CmpiDateTime() == rval.operator CmpiDateTime()); ++ case CMPI_instance: ++ case CMPI_filter: ++ case CMPI_args: ++ case CMPI_ptr: ++ case CMPI_enumeration: ++ default: ++ cerr << "unsupported equality comparison type " << _data.type << endl; ++ return false; ++ } ++} ++ ++bool CmpiData::operator!=(const CmpiData &rval) { ++ return (!(*this==rval)); ++} ++ ++bool CmpiData::operator<(const CmpiData &rval) { ++ if (_data.type != rval._data.type) ++ return _data.type < rval._data.type; ++ if (_data.state != rval._data.state) ++ return _data.state < rval._data.state; ++ if (_data.state == CMPI_nullValue ) return false; ++ if (_data.state == CMPI_notFound ) return false; ++ if (_data.state == CMPI_badValue ) return false; ++ if (_data.type & CMPI_ARRAY) ++ return (operator CmpiArray() < rval.operator CmpiArray()); ++ switch (_data.type) { ++ case CMPI_boolean: ++ return (_data.value.boolean < rval._data.value.boolean); ++ case CMPI_char16: ++ return (_data.value.char16 < rval._data.value.char16); ++ case CMPI_real32: ++ return (_data.value.real32 < rval._data.value.real32); ++ case CMPI_real64: ++ return (_data.value.real64 < rval._data.value.real64); ++ case CMPI_uint8: ++ return (_data.value.uint8 < rval._data.value.uint8); ++ case CMPI_uint16: ++ return (_data.value.uint16 < rval._data.value.uint16); ++ case CMPI_uint32: ++ return (_data.value.uint32 < rval._data.value.uint32); ++ case CMPI_uint64: ++ return (_data.value.uint64 < rval._data.value.uint64); ++ case CMPI_sint8: ++ return (_data.value.sint8 < rval._data.value.sint8); ++ case CMPI_sint16: ++ return (_data.value.sint16 < rval._data.value.sint16); ++ case CMPI_sint32: ++ return (_data.value.sint32 < rval._data.value.sint32); ++ case CMPI_sint64: ++ return (_data.value.sint64 < rval._data.value.sint64); ++ case CMPI_ref: ++ if (!_data.value.ref && !rval._data.value.ref) return false; ++ if (!_data.value.ref || !rval._data.value.ref) ++ return _data.value.ref < rval._data.value.ref; // ptr addr ++ return (operator CmpiObjectPath() < rval.operator CmpiObjectPath()); ++ case CMPI_string: ++ if (!_data.value.string && !rval._data.value.string) return false; ++ if (!_data.value.string || !rval._data.value.string) ++ return _data.value.string < rval._data.value.string; // ptr addr ++ return (operator CmpiString() < rval.operator CmpiString()); ++ case CMPI_chars: ++ if (!_data.value.chars && !rval._data.value.chars) return false; ++ if (!_data.value.chars || !rval._data.value.chars) ++ return _data.value.chars < rval._data.value.chars; // ptr addr ++ return (strcmp(_data.value.chars,rval._data.value.chars) < 0); ++ case CMPI_dateTime: ++ if (!_data.value.dateTime && !rval._data.value.dateTime) return false; ++ if (!_data.value.dateTime || !rval._data.value.dateTime) ++ return _data.value.dateTime < rval._data.value.dateTime; // ptr addr ++ return (operator CmpiDateTime() < rval.operator CmpiDateTime()); ++ case CMPI_instance: ++ case CMPI_filter: ++ case CMPI_args: ++ case CMPI_ptr: ++ case CMPI_enumeration: ++ default: ++ cerr << "unsupported equality comparison type " << _data.type << endl; ++ return false; ++ } ++} + + //--------------------------------------------------- + //-- +@@ -1087,7 +1302,7 @@ + enc=makeInstance(CmpiProviderBase::getBroker(),op); + } + +-CmpiBoolean CmpiInstance::instanceIsA(const char *className) { ++CmpiBoolean CmpiInstance::instanceIsA(const char *className) const { + return doInstanceIsA(CmpiProviderBase::getBroker(),className); + } + +@@ -1101,7 +1316,7 @@ + return inst; + } + +-CmpiBoolean CmpiInstance::doInstanceIsA(CMPIBroker *mb, const char *className) { ++CmpiBoolean CmpiInstance::doInstanceIsA(CMPIBroker *mb, const char *className) const { + CmpiObjectPath cop=getObjectPath(); + return cop.doClassPathIsA(mb,className); + } +@@ -1119,7 +1334,7 @@ + return d; + } + +-CmpiData CmpiInstance::getProperty(const int pos, CmpiString *name) { ++CmpiData CmpiInstance::getProperty(const int pos, CmpiString *name) const { + CmpiData d; + CMPIStatus rc={CMPI_RC_OK,NULL}; + CMPIString *s; +@@ -1130,23 +1345,25 @@ + else + throw CmpiStatus(rc.rc,name->charPtr()); + } +- if (name) *name=*(new CmpiString(s)); ++ if (name) *name=CmpiString(s); + return d; + }; + +-unsigned int CmpiInstance::getPropertyCount() { ++unsigned int CmpiInstance::getPropertyCount() const { + CMPIStatus rc={CMPI_RC_OK,NULL}; + unsigned int c=getEnc()->ft->getPropertyCount(getEnc(),&rc); + if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); + return c; + } + +-void CmpiInstance::setProperty(const char* name, const CmpiData data) { +- CmpiData dt=CmpiData(data); ++void CmpiInstance::setProperty(const char* name, const CmpiData& data) { + CMPIStatus rc=getEnc()->ft->setProperty(getEnc(),name, +- dt._data.type!=CMPI_chars ? &dt._data.value : (CMPIValue*)dt._data.value.chars, +- dt._data.type); +- if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); ++ data.valPtr(),data._data.type); ++ if (rc.rc!=CMPI_RC_OK) { ++ cerr << "Failed to set property: " << ++ getObjectPath().getClassName().charPtr() << "."<< name << endl; ++ throw CmpiStatus(rc); ++ } + } + + +@@ -1166,6 +1383,38 @@ + } + + ++void CmpiInstance::copyInstance(const CmpiInstance &inst) { ++ unsigned int propCount = inst.getPropertyCount(); ++ for (unsigned int i = 0; i < propCount; i++) { ++ CmpiString n; ++ CmpiData d; ++ d = inst.getProperty(i, &n); ++ setProperty(n.charPtr(), d); ++ } ++} ++ ++void CmpiInstance::copyKeys(const CmpiObjectPath &cop) { ++ unsigned int propCount = cop.getKeyCount(); ++ for (unsigned int i = 0; i < propCount; i++) { ++ CmpiString n; ++ CmpiData d; ++ d = cop.getKey(i, &n); ++ setProperty(n.charPtr(), d); ++ } ++} ++ ++bool CmpiInstance::operator==(const CmpiInstance &cmp) const { ++ return getObjectPath() == cmp.getObjectPath(); ++} ++bool CmpiInstance::operator!=(const CmpiInstance &cmp) const { ++ return (!(*this==cmp)); ++} ++bool CmpiInstance::operator<(const CmpiInstance &cmp) const { ++ return getObjectPath() < cmp.getObjectPath(); ++} ++ ++ ++ + //--------------------------------------------------- + //-- + // CmpiStatus member functions +@@ -1184,8 +1433,8 @@ + return st.rc; + } + +-const char* CmpiStatus::msg() { +- return st.msg ? CMGetCharPtr(st.msg) : 0; ++const char* CmpiStatus::msg() const { ++ return st.msg ? CMGetCharPtr(st.msg) : "(null)"; + } + + CmpiStatus::CmpiStatus() { +@@ -1202,6 +1451,10 @@ + st=stat; + } + ++CmpiStatus::~CmpiStatus() { ++} ++ ++ + //--------------------------------------------------- + //-- + // CmpiObjectPath member functions +@@ -1265,7 +1518,7 @@ + CMPIStatus rc={CMPI_RC_OK,NULL}; + CMPIString *s=getEnc()->ft->getNameSpace(getEnc(),&rc); + if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); +- return *new CmpiString(s); ++ return CmpiString(s); + } + + void CmpiObjectPath::setNameSpace(const char* ns) { +@@ -1277,7 +1530,7 @@ + CMPIStatus rc={CMPI_RC_OK,NULL}; + CMPIString *s=getEnc()->ft->getHostname(getEnc(),&rc); + if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); +- return *new CmpiString(s); ++ return CmpiString(s); + } + + void CmpiObjectPath::setHostname(const char* hn) { +@@ -1289,7 +1542,7 @@ + CMPIStatus rc={CMPI_RC_OK,NULL}; + CMPIString *s=getEnc()->ft->getClassName(getEnc(),&rc); + if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); +- return *new CmpiString(s); ++ return CmpiString(s); + } + + void CmpiObjectPath::setClassName(const char* cn) { +@@ -1316,33 +1569,100 @@ + CmpiData d; + CMPIStatus rc={CMPI_RC_OK,NULL}; + CMPIString *s; +- d._data=getEnc()->ft->getKeyAt(getEnc(),(int)pos,&s,&rc); ++d._data=getEnc()->ft->getKeyAt(getEnc(),(int)pos,&s,&rc); + if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); +- if (name) *name=*(new CmpiString(s)); ++ if (name) *name=CmpiString(s); + return d; + } + +-void CmpiObjectPath::setKey(const char* name, const CmpiData data) { +- CmpiData dt=CmpiData(data); +- CMPIStatus rc=getEnc()->ft->addKey( +- getEnc(),name, +- dt._data.type!=CMPI_chars ? &dt._data.value : (CMPIValue*)dt._data.value.chars, +- dt._data.type); ++void CmpiObjectPath::setKey(const char* name, const CmpiData& data) { ++ CMPIStatus rc=getEnc()->ft->addKey(getEnc(),name, ++ data.valPtr(),data._data.type); + if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); + } + ++bool CmpiObjectPath::operator!=(const CmpiObjectPath &cmp) const { ++ return ! (*this == cmp); ++} ++ ++bool CmpiObjectPath::operator==(const CmpiObjectPath &cmp) const { ++ try { ++ if (!getHostname().equals(cmp.getHostname())) return false; ++ if (!getNameSpace().equals(cmp.getNameSpace())) return false; ++ if (!getClassName().equals(cmp.getClassName())) return false; ++ if (getKeyCount() != cmp.getKeyCount()) return false; ++ for (unsigned int i = 0; i < getKeyCount(); i++) { ++ CmpiString name1, name2; ++ CmpiData data1, data2; ++ data1 = getKey(i, &name1); ++ data2 = cmp.getKey(name1.charPtr()); ++ if (data1 != data2) return false; ++ } ++ } catch (CmpiStatus &e) { ++ return false; ++ } ++ return true; ++} ++ ++bool CmpiObjectPath::operator<(const CmpiObjectPath &rval) const { ++ try { ++ CMPIBoolean cmp; ++ cmp = getHostname().equals(rval.getHostname()); ++ if (!cmp) return getHostname() < rval.getHostname(); ++ cmp = getNameSpace().equals(rval.getNameSpace()); ++ if (!cmp) return getNameSpace() < rval.getNameSpace(); ++ cmp = getClassName().equals(rval.getClassName()); ++ if (!cmp) return getClassName() < rval.getClassName(); ++ if (getKeyCount() != rval.getKeyCount()) ++ return getKeyCount() < rval.getKeyCount(); ++ for (unsigned int i = 0; i < getKeyCount(); i++) { ++ CmpiString name1, name2; ++ CmpiData data1, data2; ++ data1 = getKey(i, &name1); ++ try { ++ data2 = rval.getKey(name1.charPtr()); ++ if (data1 != data2) return data1 < data2; ++ } catch (const CmpiStatus &) { ++ getKey(i, &name2); ++ return name1 < name2; ++ } ++ } ++ } catch (const CmpiStatus &) { } ++ return false; ++} ++ + + //--------------------------------------------------- + //-- + // CmpiResult member functions + //-- + //--------------------------------------------------- ++struct CmpiPushFilter { ++ CmpiPushFilter(CmpiResultFilter **filter) : _filter(filter), _filterValue(*filter) { ++ *_filter = (*_filter)->nextFilter; ++ } ++ ~CmpiPushFilter() { ++ *_filter = _filterValue; ++ } ++private: ++ CmpiResultFilter **_filter; ++ CmpiResultFilter *_filterValue; ++}; + +-CmpiResult::CmpiResult() { ++CmpiResult::CmpiResult() : currentFilter(NULL), activeFilter(0), returnCount(0) { + } + +-CmpiResult::CmpiResult(CMPIResult* r) +- : CmpiObject((void*)r) { ++CmpiResult::~CmpiResult() { ++ if (returnCount > 0) { ++ std::cerr << "Caller failed to call returnDone explicitly - " ++ << returnCount << " results may be lost" << std::endl; ++ } ++} ++ ++CmpiResult::CmpiResult(CMPIResult* r) : CmpiObject((void*)r), ++ currentFilter(NULL), ++ activeFilter(0), ++ returnCount(0) { + } + + CMPIResult *CmpiResult::getEnc() const { +@@ -1350,25 +1670,215 @@ + } + + void CmpiResult::returnData(const CmpiData& d) { +- CMPIStatus rc=getEnc()->ft->returnData(getEnc(),&d._data.value,d._data.type); +- if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); ++ if (currentFilter) { ++ CmpiResultFilter *f = currentFilter; ++ CmpiPushFilter tmp(¤tFilter); ++ f->returnData(d); ++ } else { ++ CMPIStatus rc=getEnc()->ft->returnData(getEnc(),&d._data.value,d._data.type); ++ if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); ++ returnCount++; ++ } + } + + void CmpiResult::returnData(const CmpiInstance& d) { +- CMPIStatus rc=getEnc()->ft->returnInstance(getEnc(),d.getEnc()); +- if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); ++ if (currentFilter) { ++ CmpiResultFilter *f = currentFilter; ++ CmpiPushFilter tmp(¤tFilter); ++ f->returnData(d); ++ } else { ++ CMPIStatus rc=getEnc()->ft->returnInstance(getEnc(),d.getEnc()); ++ if (rc.rc!=CMPI_RC_OK) throw CmpiStatus(rc); ++ returnCount++; ++ } + } + + void CmpiResult::returnData(const CmpiObjectPath& d) { +- CMPIStatus rc=getEnc()->ft->returnObjectPath(getEnc(),d.getEnc()); +- if (rc.rc!=CMPI_RC_OK) throw Cmp... [truncated message content] |
From: <dhi...@us...> - 2007-10-06 00:20:18
|
Revision: 501 http://omc.svn.sourceforge.net/omc/?rev=501&view=rev Author: dhiltgen Date: 2007-10-05 17:20:22 -0700 (Fri, 05 Oct 2007) Log Message: ----------- Port a subset of the OMC providers to CMPI API Modified Paths: -------------- smash/branches/cmpi/Makefile.am smash/branches/cmpi/Makefile.incl.am smash/branches/cmpi/configure.ac smash/branches/cmpi/etc/Makefile.am smash/branches/cmpi/src/Makefile.am smash/branches/cmpi/src/include/omc/Smash.hpp smash/branches/cmpi/src/include/omc/SmashConfig.hpp smash/branches/cmpi/src/include/omc/SmashDevice.hpp smash/branches/cmpi/src/lib/omc/Makefile.am smash/branches/cmpi/src/lib/omc/Smash.cpp smash/branches/cmpi/src/lib/omc/SmashConfig.cpp smash/branches/cmpi/src/lib/omc/SmashDevice.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiAll.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiCimCommon.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiEntity.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiEntity.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiFru.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiFru.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiFruBoard.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiFruBoard.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiFruChassis.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiFruChassis.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiFruMulti.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiFruMulti.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiFruOptional.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiFruOptional.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiFruProduct.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiFruProduct.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfc.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfc.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfcEntity.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfcEntity.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfcFru.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfcFru.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfcSdr.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfcSdr.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfcSel.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfcSel.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfcSensor.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfcSensor.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiSdrRecord.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiSdrRecord.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiSel.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiSel.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiSelData.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiSelData.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiSensor.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiSensor.hpp smash/branches/cmpi/src/lib/omc-ipmi/Makefile.am smash/branches/cmpi/src/lib/omc-ipmi/ipmi_entity.h smash/branches/cmpi/src/lib/omc-ipmi/ipmi_fru.h smash/branches/cmpi/src/lib/omc-ipmi/ipmi_sdr.h smash/branches/cmpi/src/lib/omc-ipmi/ipmi_sel.h smash/branches/cmpi/src/lib/omc-ipmi/ipmisdg.hpp smash/branches/cmpi/src/providers/Makefile.am smash/branches/cmpi/src/providers/admin-domain-profile/CLPAdminDomain.cpp smash/branches/cmpi/src/providers/admin-domain-profile/CLPAdminDomainProfile.cpp smash/branches/cmpi/src/providers/admin-domain-profile/ElementConformsToCLPAdminDomainProfile.cpp smash/branches/cmpi/src/providers/admin-domain-profile/Makefile.am smash/branches/cmpi/src/providers/base-server-profile/BaseServerProfile.cpp smash/branches/cmpi/src/providers/base-server-profile/ElementConformsToBaseServer.cpp smash/branches/cmpi/src/providers/base-server-profile/Makefile.am smash/branches/cmpi/src/providers/base-server-profile/Notes.txt smash/branches/cmpi/src/providers/base-server-profile/ReferencedBaseServerProfile.cpp smash/branches/cmpi/src/providers/base-server-profile/RegisteredProfileInNamespace.cpp smash/branches/cmpi/src/providers/boot-control-profile/Makefile.am smash/branches/cmpi/src/providers/cpu-profile/CPUAssociatedCacheMemory.cpp smash/branches/cmpi/src/providers/cpu-profile/CPUProfile.cpp smash/branches/cmpi/src/providers/cpu-profile/ElementConformsToCPUProfile.cpp smash/branches/cmpi/src/providers/cpu-profile/Makefile.am smash/branches/cmpi/src/providers/device/Makefile.am smash/branches/cmpi/src/providers/device/composite-device/CompositeAssociations.cpp smash/branches/cmpi/src/providers/device/composite-device/CompositeCapabilitiesProvider.cpp smash/branches/cmpi/src/providers/device/composite-device/CompositeCapabilitiesProvider.hpp smash/branches/cmpi/src/providers/device/composite-device/CompositeDeviceProvider.cpp smash/branches/cmpi/src/providers/device/composite-device/CompositeDeviceProvider.hpp smash/branches/cmpi/src/providers/device/composite-device/CompositeMethods.cpp smash/branches/cmpi/src/providers/device/composite-device/Makefile.am smash/branches/cmpi/src/providers/device/composite-device/MergeInstances.cpp smash/branches/cmpi/src/providers/device/composite-device/MergeInstances.hpp smash/branches/cmpi/src/providers/device/composite-device/ResultHandlers.cpp smash/branches/cmpi/src/providers/device/composite-device/ResultHandlers.hpp smash/branches/cmpi/src/providers/device/computer-system-mirror/Makefile.am smash/branches/cmpi/src/providers/device/ipmi/APIpmiProvider.cpp smash/branches/cmpi/src/providers/device/ipmi/CSIpmiProvider.cpp smash/branches/cmpi/src/providers/device/ipmi/FWIpmiProvider.cpp smash/branches/cmpi/src/providers/device/ipmi/IpmiSelProvider.cpp smash/branches/cmpi/src/providers/device/ipmi/IpmiSelProvider.hpp smash/branches/cmpi/src/providers/device/ipmi/LogicalIpmiProvider.cpp smash/branches/cmpi/src/providers/device/ipmi/Makefile.am smash/branches/cmpi/src/providers/device/ipmi/PhysicalIpmiProvider.cpp smash/branches/cmpi/src/providers/device/ipmi/RawIpmiCommon.cpp smash/branches/cmpi/src/providers/device/ipmi/RawIpmiCommon.hpp smash/branches/cmpi/src/providers/device/ipmi/RawIpmiProvider.cpp smash/branches/cmpi/src/providers/device/ipmi/RawIpmiSensor.cpp smash/branches/cmpi/src/providers/device/ipmi/RawIpmiSensor.hpp smash/branches/cmpi/src/providers/device/ipmi/SWIpmiProvider.cpp smash/branches/cmpi/src/providers/device/ipmi/SensorProvider.cpp smash/branches/cmpi/src/providers/device/libhd/Makefile.am smash/branches/cmpi/src/providers/device/procfs/Makefile.am smash/branches/cmpi/src/providers/device/smbios/Makefile.am smash/branches/cmpi/src/providers/device/smbios/SMBIOS-CacheMemory.cpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-Card.cpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-Chassis.cpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-Chip.cpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-Debug.cpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-DeviceCapabilities.cpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-Memory.cpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-PhysicalConnector.cpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-PhysicalMemory.cpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-Processor.cpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-Provider.cpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-Provider.hpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-SMASHFirmwareIdentity.cpp smash/branches/cmpi/src/providers/device/smbios/SMBIOS-Slot.cpp smash/branches/cmpi/src/providers/device/smbios/local_debug.hpp smash/branches/cmpi/src/providers/device/sysfs/Makefile.am smash/branches/cmpi/src/providers/dhcp-client-profile/Makefile.am smash/branches/cmpi/src/providers/dns-client-profile/Makefile.am smash/branches/cmpi/src/providers/ethernet-port-profile/Makefile.am smash/branches/cmpi/src/providers/fan-profile/Makefile.am smash/branches/cmpi/src/providers/fan-profile/RegisteredFanProfile.cpp smash/branches/cmpi/src/providers/firmware-inventory-profile/HostedFirmwareCollection.cpp smash/branches/cmpi/src/providers/firmware-inventory-profile/Makefile.am smash/branches/cmpi/src/providers/firmware-inventory-profile/RegisteredFirmwareInvProfile.cpp smash/branches/cmpi/src/providers/ip-interface-profile/IPScanner.cpp smash/branches/cmpi/src/providers/ip-interface-profile/Makefile.am smash/branches/cmpi/src/providers/physical-asset-profile/ComputerSystemPackage.cpp smash/branches/cmpi/src/providers/physical-asset-profile/Makefile.am smash/branches/cmpi/src/providers/power-supply-profile/Makefile.am smash/branches/cmpi/src/providers/power-supply-profile/RegisteredPowerSupplyProfile.cpp smash/branches/cmpi/src/providers/profile-registration-profile/ElementConformsToProfileRegistrationProfile.cpp smash/branches/cmpi/src/providers/profile-registration-profile/Makefile.am smash/branches/cmpi/src/providers/profile-registration-profile/ProfileRegistrationProfile.cpp smash/branches/cmpi/src/providers/recordlog-profile/Makefile.am smash/branches/cmpi/src/providers/sensor-profile/AssociatedSensor.cpp smash/branches/cmpi/src/providers/sensor-profile/Makefile.am smash/branches/cmpi/src/providers/sensor-profile/RegisteredSensorProfile.cpp smash/branches/cmpi/src/providers/ssh-service-profile/Makefile.am smash/branches/cmpi/src/providers/system-collections-profile/Makefile.am smash/branches/cmpi/src/providers/system-memory-profile/AssociatedMemory.cpp smash/branches/cmpi/src/providers/system-memory-profile/Makefile.am smash/branches/cmpi/src/providers/system-memory-profile/RegisteredSystemMemoryProfile.cpp smash/branches/cmpi/src/providers/system-memory-profile/SystemMemoryProvider.cpp smash/branches/cmpi/src/tools/smashNs/Makefile.am smash/branches/cmpi/test/unit/sshCfg/Makefile.am Added Paths: ----------- smash/branches/cmpi/config_ipmi.mof.in smash/branches/cmpi/config_pegasus_instances.mof.in smash/branches/cmpi/config_pegasus_quals.mof smash/branches/cmpi/config_schema.mof smash/branches/cmpi/config_sfcb_instances.mof.in smash/branches/cmpi/config_smbios.mof.in smash/branches/cmpi/src/lib/omc/config.h smash/branches/cmpi/src/lib/omc-ipmi/IpmiIfcLan.hpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiLan.cpp smash/branches/cmpi/src/lib/omc-ipmi/IpmiLan.hpp smash/branches/cmpi/src/lib/omc-ipmi/config.h smash/branches/cmpi/src/providers/admin-domain-profile/adp-interop.rawreg smash/branches/cmpi/src/providers/admin-domain-profile/adp.rawreg smash/branches/cmpi/src/providers/base-server-profile/bsp.rawreg smash/branches/cmpi/src/providers/cpu-profile/cp-interop.rawreg smash/branches/cmpi/src/providers/cpu-profile/cp.rawreg smash/branches/cmpi/src/providers/device/composite-device/composite.rawreg smash/branches/cmpi/src/providers/device/ipmi/OMCFanProvider.cpp smash/branches/cmpi/src/providers/device/ipmi/ipmi.rawreg smash/branches/cmpi/src/providers/device/ipmi/raw-ipmi.rawreg smash/branches/cmpi/src/providers/device/smbios/smbios.rawreg smash/branches/cmpi/src/providers/fan-profile/fan.rawreg smash/branches/cmpi/src/providers/physical-asset-profile/pap.rawreg smash/branches/cmpi/src/providers/power-supply-profile/psp.rawreg smash/branches/cmpi/src/providers/profile-registration-profile/prp.rawreg smash/branches/cmpi/src/providers/sensor-profile/sp-interop.rawreg smash/branches/cmpi/src/providers/sensor-profile/sp.rawreg smash/branches/cmpi/src/providers/software-inventory-profile/ smash/branches/cmpi/src/providers/software-inventory-profile/ElementConformsToSoftwareInventoryProfile.cpp smash/branches/cmpi/src/providers/software-inventory-profile/InstalledSoftwareIdentity.cpp smash/branches/cmpi/src/providers/software-inventory-profile/Makefile.am smash/branches/cmpi/src/providers/software-inventory-profile/RegisteredSoftwareInventoryProfile.cpp smash/branches/cmpi/src/providers/software-inventory-profile/swid.rawreg smash/branches/cmpi/src/providers/system-memory-profile/smp-interop.rawreg smash/branches/cmpi/src/providers/system-memory-profile/smp.rawreg Modified: smash/branches/cmpi/Makefile.am =================================================================== --- smash/branches/cmpi/Makefile.am 2007-10-05 23:38:08 UTC (rev 500) +++ smash/branches/cmpi/Makefile.am 2007-10-06 00:20:22 UTC (rev 501) @@ -8,4 +8,59 @@ etc \ test +EXTRA_DIST = \ +Makefile-replacement.inc \ +create_replacement_script.sh \ +omc-smash-reg.mof.in +BUILT_SOURCES = replacement_script.sed + +CLEANFILES = replacement_script.sed + +noinst_DATA = omc-smash-reg.mof + +# Since the replacement script is listed in BUILT_SOURCES, if we include this, +# the replacement sed script will be generated before anything else (even +# subdirectories). +include ${top_srcdir}/Makefile-replacement.inc + + +omc-smash-reg.mof : omc-smash-reg.mof.in $(top_builddir)/replacement_script.sed Makefile + rm -f $@ $@.partial + @echo "Creating $@ from $<"; + sed -f $(top_builddir)/replacement_script.sed < $< > $@.partial + mv $@.partial $@ + +if ENABLE_SFCB +dist_sfcb_config_ns_DATA = config_schema.mof config_sfcb_instances.mof + +if USE_IPMI_NS +dist_sfcb_config_ns_DATA += config_ipmi.mof +endif + +if USE_SMBIOS_NS +dist_sfcb_config_ns_DATA += config_smbios.mof +endif + +install-data-hook: + $(SFCBREPOS) -f \ + -c $(sfcb_schema_dir) \ + -s $(DESTDIR)/$(sfcb_staging_dir) \ + -r $(DESTDIR)/$(sfcb_registration_dir) +endif + +if ENABLE_PEGASUS +dist_pegasus_config_ns_DATA = config_schema.mof config_pegasus_instances.mof \ + config_pegasus_quals.mof + +if USE_IPMI_NS +dist_pegasus_config_ns_DATA += config_ipmi.mof +endif + +if USE_SMBIOS_NS +dist_pegasus_config_ns_DATA += config_smbios.mof +endif + +# Pegasus processes the MOFs at install time so no install-data-hook required + +endif Modified: smash/branches/cmpi/Makefile.incl.am =================================================================== --- smash/branches/cmpi/Makefile.incl.am 2007-10-05 23:38:08 UTC (rev 500) +++ smash/branches/cmpi/Makefile.incl.am 2007-10-06 00:20:22 UTC (rev 501) @@ -2,10 +2,31 @@ # MACROS and VARIABLES # *********************************************************************** -providerdir = $(libdir)/openwbem/c++providers +# XXX May want to make this configurable eventually +providerdir = $(libdir) # *********************************************************************** # TARGETS # *********************************************************************** +# XXX need to handle INTEROP +.rawreg.classlist: + $(TEST_CLASSLIST_TOOL) $(NAMESPACES) < $< | \ + sed -e "s|@@INTEROP@@||g" > $@ + +if ENABLE_SFCB +.rawreg.reg: + $(SFCB_REG_TOOL) $(NAMESPACES) < $< | \ + sed -e "s|@@INTEROP@@|$(sfcb_interop_namespace)|g" > $@ + +endif + +if ENABLE_PEGASUS +SUFFIXES = .rawreg _PegReg.mof .reg +.rawreg_PegReg.mof: + export cimom=pegasus + $(PEGASUS_REG_TOOL) $(NAMESPACES) < $< | \ + sed -e "s|@@INTEROP@@|$(pegasus_interop_namespace)|g" > $@ +endif + Added: smash/branches/cmpi/config_ipmi.mof.in =================================================================== --- smash/branches/cmpi/config_ipmi.mof.in (rev 0) +++ smash/branches/cmpi/config_ipmi.mof.in 2007-10-06 00:20:22 UTC (rev 501) @@ -0,0 +1,5 @@ +instance of OMC_NameSpaceConfig { + Name = "ipmi"; + NameSpace = "@smash_ipmi_namespace@"; + Priority = 1; +}; Added: smash/branches/cmpi/config_pegasus_instances.mof.in =================================================================== --- smash/branches/cmpi/config_pegasus_instances.mof.in (rev 0) +++ smash/branches/cmpi/config_pegasus_instances.mof.in 2007-10-06 00:20:22 UTC (rev 501) @@ -0,0 +1,6 @@ +instance of OMC_Config { + Name = "default"; + Namespace = "@smash_namespace@"; + InteropNamespace = "@pegasus_interop_namespace@"; + StageNamespace = "@smash_internal_namespace@"; +}; Added: smash/branches/cmpi/config_pegasus_quals.mof =================================================================== --- smash/branches/cmpi/config_pegasus_quals.mof (rev 0) +++ smash/branches/cmpi/config_pegasus_quals.mof 2007-10-06 00:20:22 UTC (rev 501) @@ -0,0 +1,3 @@ +Qualifier Key : boolean = false, + Scope(property, reference), + Flavor(DisableOverride); Added: smash/branches/cmpi/config_schema.mof =================================================================== --- smash/branches/cmpi/config_schema.mof (rev 0) +++ smash/branches/cmpi/config_schema.mof 2007-10-06 00:20:22 UTC (rev 501) @@ -0,0 +1,22 @@ +class OMC_NameSpaceConfig { + [Key] + string Name; + string NameSpace; + uint16 Priority; +}; + +class OMC_Config { + [Key] + string Name; + string Namespace; + string InteropNamespace; + string StageNamespace; +}; + +class OMC_IgnoreInstanceConfig { + [Key] + string ClassName; + [Key] + string MatchProp; + string MatchValue; +}; Added: smash/branches/cmpi/config_sfcb_instances.mof.in =================================================================== --- smash/branches/cmpi/config_sfcb_instances.mof.in (rev 0) +++ smash/branches/cmpi/config_sfcb_instances.mof.in 2007-10-06 00:20:22 UTC (rev 501) @@ -0,0 +1,6 @@ +instance of OMC_Config { + Name = "default"; + Namespace = "@smash_namespace@"; + InteropNamespace = "@sfcb_interop_namespace@"; + StageNamespace = "@smash_internal_namespace@"; +}; Added: smash/branches/cmpi/config_smbios.mof.in =================================================================== --- smash/branches/cmpi/config_smbios.mof.in (rev 0) +++ smash/branches/cmpi/config_smbios.mof.in 2007-10-06 00:20:22 UTC (rev 501) @@ -0,0 +1,5 @@ +instance of OMC_NameSpaceConfig { + Name = "smbios"; + NameSpace = "@smash_smbios_namespace@"; + Priority = 2; +}; Modified: smash/branches/cmpi/configure.ac =================================================================== --- smash/branches/cmpi/configure.ac 2007-10-05 23:38:08 UTC (rev 500) +++ smash/branches/cmpi/configure.ac 2007-10-06 00:20:22 UTC (rev 501) @@ -2,13 +2,13 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(openwbem-smash-providers, 1.0.8) +AC_INIT(omc-smash-providers, 1.0.8) AM_INIT_AUTOMAKE([tar-ustar]) AC_CONFIG_SRCDIR([src]) AC_CONFIG_HEADER([config.h]) AC_PROG_LIBTOOL -AC_PREFIX_DEFAULT(/usr) +AC_PREFIX_DEFAULT(/usr/local) # Checks for programs. AC_PROG_CXX @@ -22,10 +22,12 @@ AC_PATH_PROG(MV, mv, mv) AC_PATH_PROG(CP, cp, cp) -DEBUG_FLAGS="-DDEBUG -g" # Additional debugging flags. +DEBUG_FLAGS="-DDEBUG -g -W -Werror" # Additional debugging flags. FULL_DEBUG_FLAGS="-D_GLIBCXX_DEBUG" # Additional debugging flags. -OPT_FLAGS=" -DNDEBUG -O2" # Additional optimization flags. +#XXX Need to investigate further - wont build with 'O2' flag +OPT_FLAGS="-g -DNDEBUG" # Additional optimization flags. +CFLAGS="$CFLAGS -fPIC" ##NOTE: whereever CXXFLAGS is used, we need to also use CPPFLAGS, for the AC_CHECK_HEADERS - ## It now uses compile (primarily) but still uses pre-processor for interim transition / backward compatibility @@ -59,47 +61,183 @@ ] ) -AC_ARG_WITH(openwbem-dir, - [ --with-openwbem-dir=PATH Specify an additional directory to look for openwbem include/ and lib/ sub dirs ], +####################################################################### +sfcb_interop_namespace="root/interop" +AC_ARG_WITH(sfcb-interop-namespace, + [ --with-sfcb-interop-namespace=NS Specifiy the namespace for INTEROP specific data. default = root/interop ], [ if test "x$withval" != "xno" ; then - CXXFLAGS="$CXXFLAGS -I$withval/include" - CPPFLAGS="$CPPFLAGS -I$withval/include" - CFLAGS="$CFLAGS -I$withval/include" - LDFLAGS="$LDFLAGS -L$withval/lib" + sfcb_interop_namespace="$withval" fi ] ) +AC_SUBST([sfcb_interop_namespace]) +pegasus_interop_namespace="root/PG_Interop" +AC_ARG_WITH(pegasus-interop-namespace, + [ --with-pegasus-interop-namespace=NS Specifiy the namespace for INTEROP specific data. default = root/PG_Interop ], + [ + if test "x$withval" != "xno" ; then + pegasus_interop_namespace="$withval" + fi + ] +) +AC_SUBST([pegasus_interop_namespace]) + ####################################################################### -SMASH_NAMESPACE="smash" +config_namespace="root/config" +AC_ARG_WITH(config-namespace, + [ --with-config-namespace=NS Specifiy the namespace for configurationg data. default = root/config ], + [ + if test "x$withval" != "xno" ; then + config_namespace="$withval" + fi + ] +) +AC_SUBST([config_namespace]) + +####################################################################### +#smash_namespace="smash" # XXX Doesn't work yet +smash_namespace="root/cimv2" AC_ARG_WITH(smash-namespace, - [ --with-smash-namespace=NS Specifiy the namespace for SMASH specific data. default = root/smash ], + [ --with-smash-namespace=NS Specifiy the namespace for SMASH specific data. default = smash ], [ if test "x$withval" != "xno" ; then - SMASH_NAMESPACE="$withval" + smash_namespace="$withval" fi ] ) +AC_SUBST([smash_namespace]) -AC_SUBST(SMASH_NAMESPACE) -AC_DEFINE_UNQUOTED(SMASH_NAMESPACE, "${SMASH_NAMESPACE}", "Default namespace for SMASH related data") +####################################################################### +#smash_internal_namespace="smash/internal" # XXX Doesn't work yet +smash_internal_namespace="root/cimv2" +AC_ARG_WITH(smash-internal-namespace, + [ --with-smash-internal-namespace=NS Specifiy the namespace for SMASH internal data. default = smash/internal ], + [ + if test "x$withval" != "xno" ; then + smash_internal_namespace="$withval" + fi + ] +) +AC_SUBST([smash_internal_namespace]) +####################################################################### +#smash_ipmi_namespace="smash/ipmi" # XXX Doesn't work yet +smash_ipmi_namespace="root/cimv2" +AC_ARG_WITH(smash-ipmi-namespace, + [ --with-smash-ipmi-namespace=NS Specifiy the namespace for SMASH IPMI specific data. default = smash ], + [ + if test "x$withval" != "xno" ; then + smash_ipmi_namespace="$withval" + fi + ] +) +AC_SUBST([smash_ipmi_namespace]) ####################################################################### -COMPOSITE_NAMESPACE="smash/internal" -AC_ARG_WITH(composite-namespace, - [ --with-composite-namespace=NS Specifiy the namespace for novell's aggregated SMASH data, etc. default = root/novell/smash-internal ], +#smash_smbios_namespace="smash/smbios" # XXX Doesn't work yet +smash_smbios_namespace="root/cimv2" +AC_ARG_WITH(smash-smbios-namespace, + [ --with-smash-smbios-namespace=NS Specifiy the namespace for SMASH SMBIOS specific data. default = smash ], [ if test "x$withval" != "xno" ; then - COMPOSITE_NAMESPACE="$withval" + smash_smbios_namespace="$withval" fi ] ) +AC_SUBST([smash_smbios_namespace]) -AC_SUBST(COMPOSITE_NAMESPACE) -AC_DEFINE_UNQUOTED(COMPOSITE_NAMESPACE, "${COMPOSITE_NAMESPACE}", "Default namespace for Novell's aggregated SMASH related data") +####################################################################### +sfcb_schema_dir="\$(prefix)/share/sfcb/CIM" +AC_ARG_WITH(sfcb-schema-dir, + [ --with-sfcb-schema-dir=PATH Specifiy the directory where the CIM schema results. default = /usr/local/share/sfcb/CIM ], + [ + if test "x$withval" != "xno" ; then + sfcb_schema_dir="$withval" + fi + ] +) +sfcb_staging_dir="\$(prefix)/var/lib/sfcb/stage" +AC_ARG_WITH(sfcb-staging-dir, + [ --with-sfcb-staging-dir=PATH Specifiy the directory where SFCB stages registration and mof files . default = /usr/local/var/lib/sfcb/stage ], + [ + if test "x$withval" != "xno" ; then + sfcb_staging_dir="$withval" + fi + ] +) +sfcb_registration_dir="\$(prefix)/var/lib/sfcb/registration" +AC_ARG_WITH(sfcb-registration-dir, + [ --with-sfcb-registration-dir=PATH Specifiy the directory where SFCB registration files go. default = /usr/local/var/lib/sfcb/registration ], + [ + if test "x$withval" != "xno" ; then + sfcb_registration_dir="$withval" + fi + ] +) +##################################################### + + +# Set up CIMOM specific build flags +AC_ARG_WITH([sfcb], + [AS_HELP_STRING([--with-sfcb], [Enable support for the sfcb CIMOM])], + [], [with_sfcb=no]) + +AS_IF([test "x$with_sfcb" != "xno"], + [AC_PATH_PROG([SFCBREPOS], [sfcbrepos], [])] + AS_IF([test x$SFCBREPOS = x], + [AC_MSG_ERROR([Unable to locate sfcbrepos with --enable-sfcb set])] + )) +AM_CONDITIONAL(ENABLE_SFCB, test x$with_sfcb != xno) +AC_SUBST([SFCB_REG_TOOL], "gen_sfcb_reg.pl") +AC_SUBST([TEST_CLASSLIST_TOOL], "gen_sfcb_cls.pl") +AC_SUBST([PEGASUS_REG_TOOL], "gen_pegasus_reg.pl") +AC_SUBST([sfcb_regdir], "\$(sfcb_staging_dir)/regs") +AC_SUBST([test_classlistdir], /etc/cimtest/classlist) +AC_SUBST([pegasus_regdir], /var/pegasus/omc-smash/regs) + +# Set up the locations to place the MOFs +AC_SUBST([sfcb_config_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(config_namespace)") +AC_SUBST([sfcb_interop_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(sfcb_interop_namespace)") +AC_SUBST([sfcb_smash_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(smash_namespace)") +AC_SUBST([sfcb_smash_internal_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(smash_internal_namespace)") +AC_SUBST([sfcb_smash_ipmi_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(smash_ipmi_namespace)") +AC_SUBST([sfcb_smash_smbios_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(smash_smbios_namespace)") + +AC_SUBST([sfcb_schema_dir]) +AC_SUBST([sfcb_registration_dir]) +AC_SUBST([sfcb_staging_dir]) + +AC_SUBST([pegasus_config_nsdir], + "\$(pegasus_regdir)/../mofs/\$(config_namespace)") +AC_SUBST([pegasus_interop_nsdir], + "\$(pegasus_regdir)/../mofs/\$(pegasus_interop_namespace)") +AC_SUBST([pegasus_smash_nsdir], + "\$(pegasus_regdir)/../mofs/\$(smash_namespace)") +AC_SUBST([pegasus_smash_internal_nsdir], + "\$(pegasus_regdir)/../mofs/\$(smash_internal_namespace)") +AC_SUBST([pegasus_smash_ipmi_nsdir], + "\$(pegasus_regdir)/../mofs/\$(smash_ipmi_namespace)") +AC_SUBST([pegasus_smash_smbios_nsdir], + "\$(pegasus_regdir)/../mofs/\$(smash_smbios_namespace)") + + +AC_ARG_WITH([pegasus], + [AS_HELP_STRING([--with-pegasus], [Enable support for the pegasus CIMOM])], + [], [with_pegasus=no]) +AM_CONDITIONAL(ENABLE_PEGASUS, test x$with_pegasus != xno) +# End CIMOM specific setup + + + debuglevel="0" ####################################################################### # Set the debug flag if specified @@ -163,6 +301,8 @@ use_libhd_ns=0 AC_ARG_ENABLE(libhd, AC_HELP_STRING(--disable-libhd,disable libhd aggregation namespace and providers)) +# XXX Not converted yet +enable_libhd=no if test "$enable_libhd" != no; then use_libhd_ns=1 AC_CHECK_HEADERS(hd.h, use_libhd_ns=1, use_libhd_ns=0) @@ -193,6 +333,8 @@ use_procfs_ns=0 AC_ARG_ENABLE(procfs, AC_HELP_STRING(--disable-procfs,disable procfs aggregation namespace and providers)) +# XXX Not converted yet +enable_procfs=no if test "$enable_procfs" != no; then use_procfs_ns=1 AC_CHECK_HEADERS(hd.h, use_procfs_ns=1, use_procfs_ns=0) @@ -208,6 +350,8 @@ use_sysfs_ns=0 AC_ARG_ENABLE(sysfs, AC_HELP_STRING(--disable-sysfs,disable sysfs aggregation namespace and providers)) +# XXX Not converted yet +enable_sysfs=no if test "$enable_sysfs" != no; then use_sysfs_ns=1 AC_CHECK_HEADERS(hd.h, use_sysfs_ns=1, use_sysfs_ns=0) @@ -239,39 +383,22 @@ ##################################################### # Checks for libraries. -#AC_CHECK_LIB([owcimomcommon], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owclient], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owcppprovifc], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owdb], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owhttpclient], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owhttpcommon], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owhttpxmllistener], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owprovider], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owrepositoryhdb], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owserver], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owservicehttp], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owwql], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owwqlcommon], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owxml], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([pthread], [main], [LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([crypto], [main], [LIBS="$LIBS"], [AC_MSG_ERROR(Must have libcrypto \(openssl-devel\) or build will fail)]) -# Checks for two basic and common openwbem libraries -AC_CHECK_LIB([owcimomcommon], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -AC_CHECK_LIB([owclient], [main], [LIBS="$LIBS"], [AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) - # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([openwbem/OW_config.h fcntl.h stdlib.h string.h unistd.h sys/time.h openssl/evp.h sys/param.h sys/vfs.h],,[AC_MSG_ERROR(Missing headers: likely won't compile)]) +AC_CHECK_HEADERS([cmpi/cmpidt.h fcntl.h stdlib.h string.h unistd.h sys/time.h openssl/evp.h sys/param.h sys/vfs.h],,[AC_MSG_ERROR(Missing headers: likely won't compile)]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL -AC_C_CONST + +# This causes g++ with -Os to fail +#AC_C_CONST + AC_TYPE_PID_T AC_TYPE_UID_T AC_HEADER_TIME @@ -281,12 +408,13 @@ # Checks for library functions. AC_FUNC_CLOSEDIR_VOID -AC_REPLACE_FNMATCH +#AC_REPLACE_FNMATCH AC_FUNC_FORK AC_FUNC_LSTAT AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK -AC_FUNC_MALLOC -AC_FUNC_REALLOC +# XXX Wont work with cross-compile +#AC_FUNC_MALLOC +#AC_FUNC_REALLOC AC_FUNC_CHOWN AC_FUNC_SETVBUF_REVERSED AC_FUNC_STAT @@ -318,6 +446,7 @@ src/providers/dhcp-client-profile/Makefile src/providers/ethernet-port-profile/Makefile src/providers/fan-profile/Makefile + src/providers/software-inventory-profile/Makefile src/providers/system-collections-profile/Makefile src/providers/firmware-inventory-profile/Makefile src/providers/ip-interface-profile/Makefile @@ -333,5 +462,9 @@ etc/Makefile test/Makefile test/unit/Makefile + config_sfcb_instances.mof + config_pegasus_instances.mof + config_ipmi.mof + config_smbios.mof ]) AC_OUTPUT Modified: smash/branches/cmpi/etc/Makefile.am =================================================================== --- smash/branches/cmpi/etc/Makefile.am 2007-10-05 23:38:08 UTC (rev 500) +++ smash/branches/cmpi/etc/Makefile.am 2007-10-06 00:20:22 UTC (rev 501) @@ -1,5 +1,5 @@ smashconf_DATA = smash-config.xml -smashconfdir = $(sysconfdir)/openwbem/smash-config +smashconfdir = $(sysconfdir)/omc/smash-config smashconfigopts = EXTRA_DIST = smash-config.xml.sh Modified: smash/branches/cmpi/src/Makefile.am =================================================================== --- smash/branches/cmpi/src/Makefile.am 2007-10-05 23:38:08 UTC (rev 500) +++ smash/branches/cmpi/src/Makefile.am 2007-10-06 00:20:22 UTC (rev 501) @@ -4,6 +4,7 @@ SUBDIRS = \ include \ lib \ - providers \ - tools + providers +# XXX Not converted yet +# tools Modified: smash/branches/cmpi/src/include/omc/Smash.hpp =================================================================== --- smash/branches/cmpi/src/include/omc/Smash.hpp 2007-10-05 23:38:08 UTC (rev 500) +++ smash/branches/cmpi/src/include/omc/Smash.hpp 2007-10-06 00:20:22 UTC (rev 501) @@ -1,5 +1,6 @@ /****************************************************************************** * Copyright (c) 2005,2006, Novell, Inc. All rights reserved. +* Copyright (c) 2007 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,42 +33,42 @@ #ifndef __SMASH_COMMON_HPP__ #define __SMASH_COMMON_HPP__ -#include <openwbem/OW_String.hpp> -#include <openwbem/OW_CIMDateTime.hpp> -#include <openwbem/OW_CIMObjectPath.hpp> -#include <openwbem/OW_ProviderFwd.hpp> +#include <syslog.h> +#include <string> +#include <cmpi/CmpiObjectPath.h> namespace OMCSmash { + /** * Get the system creation class name that is used as the * key to many of the CIM objects instrumented by OMC * SMASH. * @return The system creation class name as a String object. */ -OW_NAMESPACE::String getSystemCreationClassName(); +std::string getSystemCreationClassName(); /** * Get the name of the the system. This is used as the key to many CIM * objects instrumented by OMC SMASH. * @return The system name as a String object. */ -OW_NAMESPACE::String getSystemName(); +std::string getSystemName(const CmpiContext& ctx, CmpiBroker* broker); /** * Get the class name that represents the Registered Base System Profile * @return A string that contains the class name that should be used * to reference the RegisteredBaseServerProfile. */ -OW_NAMESPACE::String getRegisteredBaseServerProfileClassName(); +std::string getRegisteredBaseServerProfileClassName(); /** * Get the instance ID of the registered base system profile * @return A string that contains the Base System Profile Instance ID * */ -OW_NAMESPACE::String getBaseServerProfileInstanceID(); +std::string getBaseServerProfileInstanceID(); /** * Get the object path of the RegisteredBaseServerProfile @@ -79,15 +80,15 @@ * * @return The object path for the RegisteredBaseServerProfile */ -OW_NAMESPACE::CIMObjectPath getBaseServerProfilePath( - const OW_NAMESPACE::String& interopNameSpace); +CmpiObjectPath getBaseServerProfilePath( + const std::string &interopNameSpace); /** * Get the object path of the computer system in the smash namespace. * @return The object patch for the OMC_UnitaryComputerSystem in the * smash namespace. */ -OW_NAMESPACE::CIMObjectPath getComputerSystemObjectPath(); +CmpiObjectPath getComputerSystemObjectPath(const CmpiBroker &mbp, const CmpiContext &ctx); /** @@ -95,7 +96,7 @@ * @return A string that contains the name of the smash namespace * */ -OW_NAMESPACE::String getSmashNamespaceName(); +std::string getSmashNamespaceName(const CmpiBroker &mbp, const CmpiContext &ctx); /** @@ -103,7 +104,7 @@ * @return A string that contains the name of the hal namespace * */ -OW_NAMESPACE::String getHalNamespaceName(); +std::string getHalNamespaceName(const CmpiBroker &mbp, const CmpiContext &ctx); /** @@ -111,7 +112,7 @@ * @return A string that contains the name of the IPMI namespace * */ -OW_NAMESPACE::String getIpmiNamespaceName(); +std::string getIpmiNamespaceName(const CmpiBroker &mbp, const CmpiContext &ctx); /** @@ -120,9 +121,8 @@ * @return A string that contains the name of the Composite namespace * */ -OW_NAMESPACE::String getCompositeNamespaceName(); +std::string getCompositeNamespaceName(const CmpiBroker &mbp, const CmpiContext &ctx); - } // End of namespace OMCSmash #endif // __SMASH_COMMON_HPP__ Modified: smash/branches/cmpi/src/include/omc/SmashConfig.hpp =================================================================== --- smash/branches/cmpi/src/include/omc/SmashConfig.hpp 2007-10-05 23:38:08 UTC (rev 500) +++ smash/branches/cmpi/src/include/omc/SmashConfig.hpp 2007-10-06 00:20:22 UTC (rev 501) @@ -1,5 +1,6 @@ /****************************************************************************** * Copyright (c) 2005,2006, Novell, Inc. All rights reserved. +* Copyright (c) 2007 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,12 +33,7 @@ #ifndef SMASHCONFIG_HPP_GUARD #define SMASHCONFIG_HPP_GUARD -#include <openwbem/OW_config.h> -#include <openwbem/OW_String.hpp> -#include <openwbem/OW_XMLNode.hpp> -#include <openwbem/OW_Array.hpp> -#include <openwbem/OW_Mutex.hpp> -#include <openwbem/OW_ConfigOpts.hpp> +#include <vector> namespace OMCSmashConfig { @@ -59,6 +55,11 @@ AggregateNamespace(); /** + * Construct a new AggregateNamespace object based on the iOMC_NameSpaceConfig instance. + */ + AggregateNamespace(CmpiInstance &inst); + + /** * Construct a new AggregateNamespace object from an existing * AggregateNamespace object. * @parm arg The AggregateNamespace object to copy the new object from. @@ -75,12 +76,12 @@ AggregateNamespace& operator= ( const AggregateNamespace& arg); - OW_NAMESPACE::String m_name; - OW_NAMESPACE::String m_namespace; - OW_NAMESPACE::UInt32 m_priority; + std::string m_name; + std::string m_namespace; + CMPIUint16 m_priority; }; -typedef OW_NAMESPACE::Array<AggregateNamespace> AggregateNamespaceArray; +typedef std::vector<AggregateNamespace> AggregateNamespaceArray; /** * The IgnoreInstance structure represents hardware that should be @@ -94,12 +95,9 @@ struct IgnoreInstance { /** - * Construct a new IgnoreInstance object from an XMLNode - * @parm node An XMLNode that is expected to point to an - * <ignore_instance> XML tag. + * Construct a new IgnoreInstance object from an OMC_IgnoreInstanceConfig instance */ - IgnoreInstance( - const OW_NAMESPACE::XMLNode& node); + IgnoreInstance(CmpiInstance &inst); /** * Construct a new empty IgnoreInstance object. @@ -123,52 +121,48 @@ IgnoreInstance& operator= ( const IgnoreInstance& arg); - OW_NAMESPACE::String m_className; - OW_NAMESPACE::String m_matchProp; - OW_NAMESPACE::String m_matchValue; + std::string m_className; + std::string m_matchProp; + std::string m_matchValue; }; -typedef OW_NAMESPACE::Array<IgnoreInstance> IgnoreInstanceArray; +typedef std::vector<IgnoreInstance> IgnoreInstanceArray; -/** - * @return the directory name where the configuration files area stored. - */ -OW_NAMESPACE::String getConfigDir(); /** * @return true If the configuration is invalid. Otherwise false. */ -bool isInvalid(); +//bool isInvalid(); /** * Read all of the configuration data. */ -void readConfig(); +void readConfig(const CmpiBroker &mbp, const CmpiContext &ctx); /** * @return the Smash namespace from the configuration. */ -OW_NAMESPACE::String getSmashNs(); +std::string getSmashNs(const CmpiBroker &mbp, const CmpiContext &ctx); /** * @return the IPMI namespace from the configuration. */ -OW_NAMESPACE::String getIpmiNs(); +std::string getIpmiNs(const CmpiBroker &mbp, const CmpiContext &ctx); /** * @return the HAL namespace from the configuration. */ -OW_NAMESPACE::String getHalNs(); +std::string getHalNs(const CmpiBroker &mbp, const CmpiContext &ctx); /** * @return the Smash staging namespace from the configuration. */ -OW_NAMESPACE::String getSmashStageNs(); +std::string getSmashStageNs(const CmpiBroker &mbp, const CmpiContext &ctx); /** * @return All the namespaces that are involved in the logical device/ * physical element aggregation. */ -AggregateNamespaceArray getAggregateNamespaces(); +AggregateNamespaceArray getAggregateNamespaces(const CmpiBroker &mbp, const CmpiContext &ctx); /** * Determine the namespace that is associated with the given name @@ -176,7 +170,7 @@ * @return The namespace associated with the given name if found. * Otherwise an empty string. */ -OW_NAMESPACE::String getAggregateNamespace(const OW_NAMESPACE::String& name); +std::string getAggregateNamespace(const CmpiBroker &mbp, const CmpiContext &ctx, const std::string& name); /** * Get all of the IgnoreInstance objects from the omc-smash @@ -186,9 +180,10 @@ * @return An array of IgnoreInstance objects that match the search * criteria. */ -IgnoreInstanceArray getIgnoreInstances( - const OW_NAMESPACE::String& className=OW_NAMESPACE::String()); +IgnoreInstanceArray getIgnoreInstances(const CmpiBroker &mbp, const CmpiContext &ctx, + const std::string& className=std::string()); + /** * Get the namespaces that need to be looked at when handling a given * class name. @@ -196,12 +191,15 @@ * @param nsToCombine An output StringArray that will hold the namespaces * to process for the given classname. */ -void getAggregatedNamespaceList( - const OW_NAMESPACE::String& omcResultClass, - OW_NAMESPACE::StringArray& nsToCombine); +void getAggregatedNamespaceList(const CmpiBroker &mbp, const CmpiContext &ctx, + const std::string& omcResultClass, + std::vector<std::string> &nsToCombine); -const char* const INTEROP_NS_opt = OW_NAMESPACE::ConfigOpts::INTEROP_SCHEMA_NAMESPACE_opt; +// XXX Convert to calls to getInteropNamespace() +//const char* const INTEROP_NS_opt = "root/interop"; +std::string getInteropNamespace(const CmpiBroker &mbp, const CmpiContext &ctx); + } // End of namespace OMCSmashConfig #endif // SMASHCONFIG_HPP_GUARD Modified: smash/branches/cmpi/src/include/omc/SmashDevice.hpp =================================================================== --- smash/branches/cmpi/src/include/omc/SmashDevice.hpp 2007-10-05 23:38:08 UTC (rev 500) +++ smash/branches/cmpi/src/include/omc/SmashDevice.hpp 2007-10-06 00:20:22 UTC (rev 501) @@ -1,5 +1,6 @@ /****************************************************************************** * Copyright (c) 2005,2006, Novell, Inc. All rights reserved. +* Copyright (c) 2007 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,8 +33,9 @@ #ifndef SMASHDEV_TYPES_HPP_GUARD #define SMASHDEV_TYPES_HPP_GUARD -#include <openwbem/OW_String.hpp> -#include <openwbem/OW_CIMInstance.hpp> +#include <string> +#include <cmpi/CmpiInstance.h> +#include <cmpi/CmpiObjectPath.h> namespace OMCSmash { @@ -281,11 +283,11 @@ * @param sequenceNumber The sequence number part of the key. * @return The device key as a String object. */ -OpenWBEM::String createDeviceKey( +std::string createDeviceKey( int deviceNumber, int sequenceNumber); -OpenWBEM::String createDeviceKey( +std::string createDeviceKey( int deviceNumber, char *sequenceNumber); @@ -299,10 +301,11 @@ * @return true if strKey was parsed successfully. Otherwise false. */ bool parseDeviceKey( - const OpenWBEM::String& strKey, + const std::string& strKey, int& deviceNumberOut, int& sequenceNumberOut); +#if (0 && __VMWARE) /** * Get a value for a given variable name out of the 'OtherIdentifyingInfo' * property. @@ -311,10 +314,11 @@ * @return The value of the given variable from the 'OtherIdentifyingInfo' * property on success. Otherwise an empty string. */ -OpenWBEM::String getOIIValue( - const OpenWBEM::String& varName, - const OpenWBEM::CIMInstance& ci); +std::string getOIIValue( + const std::string& varName, + const CmpiInstance& ci); +#endif /** * Given a physical element class name and a tag, return the appropriate @@ -324,15 +328,15 @@ * @param ns * @return CIMObjectPath: the object path to the object */ -OpenWBEM::CIMObjectPath createPhysicalElementObjectPath( - const OpenWBEM::String &physicalElementClassName, - const OpenWBEM::String &tag, - const OpenWBEM::String &ns); +CmpiObjectPath createPhysicalElementObjectPath( + const std::string &physicalElementClassName, + const std::string &tag, + const std::string &ns); -OpenWBEM::CIMObjectPath createLogicalDeviceObjectPath( - const OpenWBEM::String &logicalDeviceClassName, - const OpenWBEM::String &deviceId, - const OpenWBEM::String &ns); +CmpiObjectPath createLogicalDeviceObjectPath( + const std::string &logicalDeviceClassName, + const std::string &deviceId, + const std::string &ns); /** * Convert a IPMI entity ID to a device ID that will be used in a @@ -361,7 +365,7 @@ */ bool ipmiEntityId2Physical( int entityId, - OpenWBEM::String& physicalClassName); + std::string& physicalClassName); /** * Determine the logical class names for the given IPMI entity ID. @@ -373,7 +377,7 @@ */ bool ipmiEntityId2Logical( int entityId, - OpenWBEM::String& logicalClassName); + std::string& logicalClassName); /** * Determine the logical and physical class names for the given IPMI entity ID. @@ -388,8 +392,8 @@ */ bool ipmiEntityId2LogicalPhysical( int entityId, - OpenWBEM::String& physicalClassName, - OpenWBEM::String& logicalClassName); + std::string& physicalClassName, + std::string& logicalClassName); /** * Determine the logical and physical class names for the given device id. @@ -404,8 +408,8 @@ */ bool deviceId2LogicalPhysical( int deviceId, - OpenWBEM::String& physicalClassName, - OpenWBEM::String& logicalClassName); + std::string& physicalClassName, + std::string& logicalClassName); /** * Determine the logical or physical class name for the given device id. @@ -413,8 +417,8 @@ * @return The logical or physical class name that corresponds to deviceId * if found. Otherwise an empty string. */ -OpenWBEM::String deviceId2LogicalClass(int deviceId); -OpenWBEM::String deviceId2PhysicalClass(int deviceId); +std::string deviceId2LogicalClass(int deviceId); +std::string deviceId2PhysicalClass(int deviceId); /** * Determine the physical class name for the given deviceId string. @@ -425,7 +429,7 @@ * @return The name of the physical class that corresponds to the device key on * success. An empty string if the determination cannot be made. */ -OpenWBEM::String deviceIdKey2PhysicalClass(const OpenWBEM::String& devidKey); +std::string deviceIdKey2PhysicalClass(const std::string& devidKey); /** * Determine the logical class name for the given deviceId string. @@ -436,7 +440,7 @@ * @return The name of the logical class that corresponds to the device key on * success. An empty string if the determination cannot be made. */ -OpenWBEM::String deviceIdKey2LogicalClass(const OpenWBEM::String& devidKey); +std::string deviceIdKey2LogicalClass(const std::string& devidKey); /** * Determine if a given class name is a logical class name for hardware @@ -446,7 +450,7 @@ * instrumented by omc-smash */ bool isSmashLogicalClass( - const OpenWBEM::String& logicalClassName); + const std::string& logicalClassName); /** * Determine if a given class name is a physical class name for an hardware @@ -456,7 +460,7 @@ * instrumented by omc-smash */ bool isSmashPhysicalClass( - const OpenWBEM::String& physicalClassName); + const std::string& physicalClassName); /** * Determine if the logical class has a SystemDevice association. @@ -466,7 +470,7 @@ * should exist * @return true if there is a SystemDevice association. Otherwise false. */ -bool logicalIsSystemDevice(const OpenWBEM::String& className); +bool logicalIsSystemDevice(const std::string& className); bool logicalIsSystemDevice(int deviceId); /** @@ -476,7 +480,7 @@ * error occurred during the determination. * @return true if the current system is IPMI enabled. Otherwise false. */ -bool ipmiAvailable(OpenWBEM::String& errMsg); +bool ipmiAvailable(std::string& errMsg); } // End of namespace OMCSmash Modified: smash/branches/cmpi/src/lib/omc/Makefile.am =================================================================== --- smash/branches/cmpi/src/lib/omc/Makefile.am 2007-10-05 23:38:08 UTC (rev 500) +++ smash/branches/cmpi/src/lib/omc/Makefile.am 2007-10-06 00:20:22 UTC (rev 501) @@ -8,13 +8,18 @@ INCLUDES = \ -I$(top_srcdir)/src/include/omc \ -I$(top_builddir)/../novell-provider-base/src/include - + +CXXFLAGS = -DCONFIG_NAMESPACE=\"@config_namespace@\" \ + -DCOMPOSITE_NAMESPACE=\"@smash_internal_namespace@\" \ + -DSMASH_NAMESPACE=\"@smash_namespace@\" + libomcsmash_la_LDFLAGS = -version-info 1 libomcsmash_la_SOURCES = \ Smash.cpp \ SmashDevice.cpp \ - SmashConfig.cpp \ - SSHConfig.cpp + SmashConfig.cpp +# XXX Not yet converted to CMPI +# SSHConfig.cpp Modified: smash/branches/cmpi/src/lib/omc/Smash.cpp =================================================================== --- smash/branches/cmpi/src/lib/omc/Smash.cpp 2007-10-05 23:38:08 UTC (rev 500) +++ smash/branches/cmpi/src/lib/omc/Smash.cpp 2007-10-06 00:20:22 UTC (rev 501) @@ -1,5 +1,6 @@ /****************************************************************************** * Copyright (c) 2005,2006, Novell, Inc. All rights reserved. +* Copyright (c) 2007 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,103 +33,96 @@ #include "config.h" -#include <openwbem/OW_config.h> +#include <omc/Base.hpp> #include "Smash.hpp" #include "SmashConfig.hpp" -#include <openwbem/OW_CIMValue.hpp> -#include <openwbem/OW_SocketAddress.hpp> -#include <openwbem/OW_DateTime.hpp> -#include <openwbem/OW_Array.hpp> -#include <openwbem/OW_Exec.hpp> -#include <omc/Base.hpp> namespace OMCSmash { - -using namespace OpenWBEM; using namespace OMC; -#define REG_BASE_SERVER_PROFILE_CLASS_NAME "OMC_RegisteredBaseServerProfile" -#define BASE_SERVER_PROFILE_INSTANCE_ID_NAME "baseServerProfile" - ////////////////////////////////////////////////////////////////////////////// -String +std::string getSystemCreationClassName() { return OMC::getComputerSystemClassName(); } ////////////////////////////////////////////////////////////////////////////// -String -getSystemName() +std::string +getSystemName(const CmpiContext& ctx, CmpiBroker* broker) { - return OMC::getComputerSystemName(); + return OMC::getComputerSystemName(ctx, broker); } + +#define REG_BASE_SERVER_PROFILE_CLASS_NAME "OMC_RegisteredBaseServerProfile" +#define BASE_SERVER_PROFILE_INSTANCE_ID_NAME "baseServerProfile" + ////////////////////////////////////////////////////////////////////////////// -String +std::string getRegisteredBaseServerProfileClassName() { - return String(REG_BASE_SERVER_PROFILE_CLASS_NAME); + return std::string(REG_BASE_SERVER_PROFILE_CLASS_NAME); } ////////////////////////////////////////////////////////////////////////////// -String +std::string getBaseServerProfileInstanceID() { - return makeInstanceID(String(BASE_SERVER_PROFILE_INSTANCE_ID_NAME)); + return makeInstanceID(std::string(BASE_SERVER_PROFILE_INSTANCE_ID_NAME)); } - ////////////////////////////////////////////////////////////////////////////// -CIMObjectPath -getBaseServerProfilePath(const String& interopNameSpace) +CmpiObjectPath +getBaseServerProfilePath(const std::string& interopNameSpace) { - CIMObjectPath baseServerProfilePath( - REG_BASE_SERVER_PROFILE_CLASS_NAME, interopNameSpace); - baseServerProfilePath.setKeyValue("InstanceID", - CIMValue(getBaseServerProfileInstanceID())); + CmpiObjectPath baseServerProfilePath( + interopNameSpace.c_str(), REG_BASE_SERVER_PROFILE_CLASS_NAME); + baseServerProfilePath.setKey("InstanceID", + getBaseServerProfileInstanceID().c_str()); return baseServerProfilePath; } ////////////////////////////////////////////////////////////////////////////// -CIMObjectPath -getComputerSystemObjectPath() +CmpiObjectPath +getComputerSystemObjectPath(const CmpiBroker &mbp, const CmpiContext &ctx) { - CIMObjectPath cop("OMC_UnitaryComputerSystem", getSmashNamespaceName()); - cop.setKeyValue("CreationClassName", CIMValue("OMC_UnitaryComputerSystem")); - cop.setKeyValue("Name", CIMValue(OMC::getComputerSystemName())); + CmpiObjectPath cop(getSmashNamespaceName(mbp, ctx).c_str(), + "OMC_UnitaryComputerSystem"); + cop.setKey("CreationClassName", "OMC_UnitaryComputerSystem"); + cop.setKey("Name", OMC::getComputerSystemName(ctx, &mbp).c_str()); return cop; } ////////////////////////////////////////////////////////////////////////////// -String getSmashNamespaceName() +std::string getSmashNamespaceName(const CmpiBroker &mbp, const CmpiContext &ctx) { - return OMCSmashConfig::getSmashNs(); + return OMCSmashConfig::getSmashNs(mbp, ctx); } ////////////////////////////////////////////////////////////////////////////// -String getHalNamespaceName() +std::string getHalNamespaceName(const CmpiBroker &mbp, const CmpiContext &ctx) { - return OMCSmashConfig::getHalNs(); + return OMCSmashConfig::getHalNs(mbp, ctx); } ////////////////////////////////////////////////////////////////////////////// -String getIpmiNamespaceName() +std::string getIpmiNamespaceName(const CmpiBroker &mbp, const CmpiContext &ctx) { - return OMCSmashConfig::getIpmiNs(); + return OMCSmashConfig::getIpmiNs(mbp, ctx); } ////////////////////////////////////////////////////////////////////////////// -String getCompositeNamespaceName() -{return OMCSmashConfig::getSmashStageNs(); +std::string getCompositeNamespaceName(const CmpiBroker &mbp, const CmpiContext &ctx) +{ + return OMCSmashConfig::getSmashStageNs(mbp, ctx); } - } // End of namespace OMCSmash Modified: smash/branches/cmpi/src/lib/omc/SmashConfig.cpp =================================================================== --- smash/branches/cmpi/src/lib/omc/SmashConfig.cpp 2007-10-05 23:38:08 UTC (rev 500) +++ smash/branches/cmpi/src/lib/omc/SmashConfig.cpp 2007-10-06 00:20:22 UTC (rev 501) @@ -1,5 +1,6 @@ /****************************************************************************** * Copyright (c) 2005,2006, Novell, Inc. All rights reserved. +* Copyright (c) 2007 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,28 +30,36 @@ * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ +#include <omc/Sync.hpp> +#include "Smash.hpp" #include "config.h" #include "SmashConfig.hpp" -#include <openwbem/OW_config.h> -#include <openwbem/OW_XMLParserDOM.hpp> -#include <openwbem/OW_FileSystem.hpp> -#include <openwbem/OW_MutexLock.hpp> +#include <omc/Base.hpp> #include <iostream> #include <fstream> #include <algorithm> -using namespace OW_NAMESPACE; +using std::string; +using namespace OMC; namespace OMCSmashConfig { +static const char configNS[] = CONFIG_NAMESPACE; +static const char compositeNS[] = COMPOSITE_NAMESPACE; +static const char smashNS[] = SMASH_NAMESPACE; +static const char configClass[] = "OMC_Config"; +static const char configNamespaceClass[] = "OMC_NameSpaceConfig"; +static const char configIgnoreClass[] = "OMC_IgnoreInstanceConfig"; + +#if (0 && __VMWARE__) ////////////////////////////////////////////////////////////////////////////// bool -stringInArray(const StringArray& arg, const String& name) +stringInArray(const /*stringarray*/ char*& arg, const string& name) { bool cc = false; - for(StringArray::size_type i = 0; i < arg.size(); i++) + for(/*stringarray*/ char*::size_type i = 0; i < arg.size(); i++) { if(name.equalsIgnoreCase(arg[i])) { @@ -61,6 +70,7 @@ return cc; } +#endif ////////////////////////////////////////////////////////////////////////////// struct AscendingAggNamespaceSort @@ -74,17 +84,6 @@ }; -#define SMCONFIG_CONFIG_TAG "omc_smash_config" -#define SMCONFIG_AGG_NS_TAG "aggregate_namespace" -#define SMCONFIG_ATTR_NAME "name" -#define SMCONFIG_ATTR_PRIORITY "priority" -#define SMCONFIG_IGN_INSTANCE_TAG "ignore_instance" -#define SMCONFIG_ATTR_VER "version" -#define SMCONFIG_ATTR_CLS_NAME "class_name" -#define SMCONFIG_ATTR_MATCH_PROP "match_property" -#define SMCONFIG_ATTR_MATCH_VALUE "match_value" -#define SMCONFIG_SMASH_NS "smash_namespace" -#define SMCONFIG_STAGE_NS "smash_stage_namespace" /** * The SmashConfig class is an abstraction for OMC's SMASH implementation. @@ -92,172 +91,216 @@ class SmashConfigImpl { public: - SmashConfigImpl(); - String getConfigDir() const; - bool isInvalid() const { return m_isInvalid; } - void readConfig(); - String getSmashNs() const; - String getSmashStageNs() const; + SmashConfigImpl(const CmpiBroker &mbp, const CmpiContext &ctx); + //bool isInvalid() const { return m_isInvalid; } + void readConfig(const CmpiBroker &mbp, const CmpiContext &ctx); + string getInteropNs() const; + string getSmashNs() const; + string getSmashStageNs() const; AggregateNamespaceArray getAggregateNamespaces() const; - String getAggregateNamespace(const String& name) const; + string getAggregateNamespace(const string& name) const; - void getAggregatedNamespaceList(const OW_NAMESPACE::String& className, - StringArray& nsToCombine) const; + void getAggregatedNamespaceList(const string& className, + std::vector<std::string> &nsToCombine) const; - int processConfFile(const String& fileNameArg); - int parseConfigDoc(const XMLNode& rootNode); void defaultNameSpaces(); IgnoreInstanceArray getIgnoreInstances( - const String& className=String()); + const string& className=string()); bool m_isInvalid; - String m_configDir; - String m_smashNs; - String m_smashStageNs; + string m_interopNs; + string m_smashNs; + string m_smashStageNs; AggregateNamespaceArray m_aggNamespaces; IgnoreInstanceArray m_ignInstances; mutable Mutex m_guard; }; -SmashConfigImpl g_smconfig; +// Singleton configuration data +Mutex g_guard; +SmashConfigImpl *g_smconfig = NULL; -////////////////////////////////////////////////////////////////////////////// -String -getConfigDir() -{ - return g_smconfig.getConfigDir(); -} -////////////////////////////////////////////////////////////////////////////// -bool -isInvalid() -{ - return g_smconfig.isInvalid(); +void singletonInit(const CmpiBroker &mbp, const CmpiContext &ctx) { + MutexLock ml(g_guard); + if (g_smconfig == NULL) { + g_smconfig = new SmashConfigImpl(mbp, ctx); + } } + + ////////////////////////////////////////////////////////////////////////////// void -readConfig() +readConfig(const CmpiBroker &mbp, const CmpiContext &ctx) { - g_smconfig.readConfig(); + singletonInit(mbp, ctx); + g_smconfig->readConfig(mbp, ctx); } ////////////////////////////////////////////////////////////////////////////// -String -getSmashNs() +string +getSmashNs(const CmpiBroker &mbp, const CmpiContext &ctx) { - return g_smconfig.getSmashNs(); + singletonInit(mbp, ctx); + return g_smconfig->getSmashNs(); } ////////////////////////////////////////////////////////////////////////////// -String -getIpmiNs() +string +getIpmiNs(const CmpiBroker &mbp, const CmpiContext &ctx) { - return g_smconfig.getAggregateNamespace("ipmi"); + singletonInit(mbp, ctx); + return g_smconfig->getAggregateNamespace("ipmi"); } ////////////////////////////////////////////////////////////////////////////// -String -getHalNs() +string +getHalNs(const CmpiBroker &mbp, const CmpiContext &ctx) { - return g_smconfig.getAggregateNamespace("hal"); + singletonInit(mbp, ctx); + return g_smconfig->getAggregateNamespace("hal"); } ////////////////////////////////////////////////////////////////////////////// -String -getSmashStageNs() +string +getSmashStageNs(const CmpiBroker &mbp, const CmpiContext &ctx) { - return g_smconfig.getSmashStageNs(); + singletonInit(mbp, ctx); + return g_smconfig->getSmashStageNs(); } + +string +getInteropNamespace(const CmpiBroker &mbp, const CmpiContext &ctx) { + singletonInit(mbp, ctx); + return g_smconfig->getInteropNs(); +} + ////////////////... [truncated message content] |
From: <dhi...@us...> - 2007-10-05 23:38:07
|
Revision: 500 http://omc.svn.sourceforge.net/omc/?rev=500&view=rev Author: dhiltgen Date: 2007-10-05 16:38:08 -0700 (Fri, 05 Oct 2007) Log Message: ----------- Port a subset of the OMC providers to CMPI API Modified Paths: -------------- base/branches/cmpi/Makefile.am base/branches/cmpi/Makefile.incl.am base/branches/cmpi/configure.ac base/branches/cmpi/src/include/omc/Base.hpp base/branches/cmpi/src/include/omc/Makefile.am base/branches/cmpi/src/include/omc/ProviderStore.hpp base/branches/cmpi/src/lib/omc/Base.cpp base/branches/cmpi/src/lib/omc/CIMUtils.cpp base/branches/cmpi/src/lib/omc/FileFilter.cpp base/branches/cmpi/src/lib/omc/FileTools.cpp base/branches/cmpi/src/lib/omc/LinuxProcess.cpp base/branches/cmpi/src/lib/omc/Makefile.am base/branches/cmpi/src/lib/omc/ProviderStore.cpp base/branches/cmpi/src/providers/Makefile.am base/branches/cmpi/src/providers/computer-system/LinuxComputerSystem.cpp base/branches/cmpi/src/providers/computer-system/Makefile.am base/branches/cmpi/src/providers/file-system/Makefile.am base/branches/cmpi/src/providers/operating-system/Makefile.am base/branches/cmpi/src/providers/posix-file-elements/Makefile.am base/branches/cmpi/src/providers/processes/Makefile.am base/branches/cmpi/src/providers/syslog/Makefile.am base/branches/cmpi/src/providers/time-service/Makefile.am Added Paths: ----------- base/branches/cmpi/gen_pegasus_reg.pl base/branches/cmpi/gen_sfcb_cls.pl base/branches/cmpi/gen_sfcb_reg.pl base/branches/cmpi/src/include/omc/AtomicOps.hpp base/branches/cmpi/src/include/omc/CmpiUtils.hpp base/branches/cmpi/src/include/omc/RefCount.hpp base/branches/cmpi/src/include/omc/Reference.hpp base/branches/cmpi/src/include/omc/ReferenceBase.hpp base/branches/cmpi/src/include/omc/SimpleAssociationMI.hpp base/branches/cmpi/src/include/omc/Sync.hpp base/branches/cmpi/src/lib/omc/AtomicOps.cpp base/branches/cmpi/src/lib/omc/CmpiUtils.cpp base/branches/cmpi/src/lib/omc/ReferenceBase.cpp base/branches/cmpi/src/lib/omc/SimpleAssociationMI.cpp base/branches/cmpi/src/providers/computer-system/cs.rawreg Modified: base/branches/cmpi/Makefile.am =================================================================== --- base/branches/cmpi/Makefile.am 2007-10-05 23:20:20 UTC (rev 499) +++ base/branches/cmpi/Makefile.am 2007-10-05 23:38:08 UTC (rev 500) @@ -18,6 +18,8 @@ noinst_DATA = reg.mof +bin_SCRIPTS = gen_pegasus_reg.pl gen_sfcb_reg.pl gen_sfcb_cls.pl + # Since the replacement script is listed in BUILT_SOURCES, if we include this, # the replacement sed script will be generated before anything else (even # subdirectories). Modified: base/branches/cmpi/Makefile.incl.am =================================================================== --- base/branches/cmpi/Makefile.incl.am 2007-10-05 23:20:20 UTC (rev 499) +++ base/branches/cmpi/Makefile.incl.am 2007-10-05 23:38:08 UTC (rev 500) @@ -2,11 +2,26 @@ # MACROS and VARIABLES # *********************************************************************** -providerdir = $(libdir)/openwbem/c++providers -oopproviderdir = $(libdir)/openwbem/oopproviders +# XXX Should make configurable +providerdir = $(libdir) +oopproviderdir = $(libdir) + # *********************************************************************** # TARGETS # *********************************************************************** +.rawreg.classlist: + $(PERL) $(TEST_CLASSLIST_TOOL) $(NAMESPACES) < $< > $@ + +if ENABLE_SFCB +.rawreg.reg: + $(PERL) $(SFCB_REG_TOOL) $(NAMESPACES) < $< > $@ +endif + +if ENABLE_PEGASUS +SUFFIXES = .rawreg _PegReg.mof .reg +.rawreg_PegReg.mof: + $(PERL) $(PEGASUS_REG_TOOL) $(NAMESPACES) < $< > $@ +endif Modified: base/branches/cmpi/configure.ac =================================================================== --- base/branches/cmpi/configure.ac 2007-10-05 23:20:20 UTC (rev 499) +++ base/branches/cmpi/configure.ac 2007-10-05 23:38:08 UTC (rev 500) @@ -8,8 +8,9 @@ AC_CONFIG_HEADER([config.h]) AC_PROG_LIBTOOL -AC_PREFIX_DEFAULT(/usr) +AC_PREFIX_DEFAULT(/usr/local) + # Checks for programs. AC_PROG_CXX AC_PROG_CC @@ -24,11 +25,14 @@ AC_PATH_PROG(MV, mv, mv) AC_PATH_PROG(CP, cp, cp) -DEBUG_FLAGS="-DDEBUG -g" # Additional debugging flags. +DEBUG_FLAGS="-DDEBUG -g -Wall -W -Werror" # Additional debugging flags. FULL_DEBUG_FLAGS="-D_GLIBCXX_DEBUG" # Additional debugging flags. -OPT_FLAGS=" -DNDEBUG -O2" # Additional optimization flags. +#XXX Need to investigate further - wont build with 'O2' flag +OPT_FLAGS="-g -DNDEBUG" # Additional optimization flags. +CFLAGS="$CFLAGS -fPIC" + ##NOTE: whereever CXXFLAGS is used, we need to also use CPPFLAGS, for the AC_CHECK_HEADERS - ## It now uses compile (primarily) but still uses pre-processor for interim transition / backward compatibility ## pre-processor needs the CPPFLAGS @@ -58,9 +62,146 @@ fi ] ) +AC_SUBST([interop_namespace]) -AC_DEFINE_UNQUOTED(INTEROP_NAMESPACE, "${interop_namespace}", "The namespace for INTEROP specific data") +####################################################################### +#smash_namespace="smash" # XXX Doesn't work yet +smash_namespace="root/cimv2" +AC_ARG_WITH(smash-namespace, + [ --with-smash-namespace=NS Specifiy the namespace for SMASH specific data. default = smash ], + [ + if test "x$withval" != "xno" ; then + smash_namespace="$withval" + fi + ] +) +AC_SUBST([smash_namespace]) +####################################################################### +#smash_internal_namespace="smash/internal" # XXX Doesn't work yet +smash_internal_namespace="root/cimv2" +AC_ARG_WITH(smash-internal-namespace, + [ --with-smash-internal-namespace=NS Specifiy the namespace for SMASH internal data. default = smash/internal ], + [ + if test "x$withval" != "xno" ; then + smash_internal_namespace="$withval" + fi + ] +) +AC_SUBST([smash_internal_namespace]) + +####################################################################### +#smash_ipmi_namespace="smash/ipmi" # XXX Doesn't work yet +smash_ipmi_namespace="root/cimv2" +AC_ARG_WITH(smash-ipmi-namespace, + [ --with-smash-ipmi-namespace=NS Specifiy the namespace for SMASH IPMI specific data. default = smash ], + [ + if test "x$withval" != "xno" ; then + smash_ipmi_namespace="$withval" + fi + ] +) +AC_SUBST([smash_ipmi_namespace]) + +####################################################################### +#smash_smbios_namespace="smash/smbios" # XXX Doesn't work yet +smash_smbios_namespace="root/cimv2" +AC_ARG_WITH(smash-smbios-namespace, + [ --with-smash-smbios-namespace=NS Specifiy the namespace for SMASH SMBIOS specific data. default = smash ], + [ + if test "x$withval" != "xno" ; then + smash_smbios_namespace="$withval" + fi + ] +) +AC_SUBST([smash_smbios_namespace]) + +####################################################################### +sfcb_schema_dir="\$(prefix)/share/sfcb/CIM" +AC_ARG_WITH(sfcb-schema-dir, + [ --with-sfcb-schema-dir=PATH Specifiy the directory where the CIM schema results. default = /usr/local/share/sfcb/CIM ], + [ + if test "x$withval" != "xno" ; then + sfcb_schema_dir="$withval" + fi + ] +) +sfcb_staging_dir="\$(prefix)/var/lib/sfcb/stage" +AC_ARG_WITH(sfcb-staging-dir, + [ --with-sfcb-staging-dir=PATH Specifiy the directory where SFCB stages registration and mof files . default = /usr/local/var/lib/sfcb/stage ], + [ + if test "x$withval" != "xno" ; then + sfcb_staging_dir="$withval" + fi + ] +) +sfcb_registration_dir="\$(prefix)/var/lib/sfcb/registration" +AC_ARG_WITH(sfcb-registration-dir, + [ --with-sfcb-registration-dir=PATH Specifiy the directory where SFCB registration files go. default = /usr/local/var/lib/sfcb/registration ], + [ + if test "x$withval" != "xno" ; then + sfcb_registration_dir="$withval" + fi + ] +) + +##################################################### + + +# Set up CIMOM specific build flags +AC_ARG_WITH([sfcb], + [AS_HELP_STRING([--with-sfcb], [Enable support for the sfcb CIMOM])], + [], [with_sfcb=no]) + +AS_IF([test "x$with_sfcb" != "xno"], + [AC_PATH_PROG([SFCBREPOS], [sfcbrepos], [])] + AS_IF([test x$SFCBREPOS = x], + [AC_MSG_ERROR([Unable to locate sfcbrepos with --enable-sfcb set])] + )) +AM_CONDITIONAL(ENABLE_SFCB, test x$with_sfcb != xno) +AC_SUBST([SFCB_REG_TOOL], "\$(top_srcdir)/gen_sfcb_reg.pl") +AC_SUBST([TEST_CLASSLIST_TOOL], "\$(top_srcdir)/gen_sfcb_cls.pl") +AC_SUBST([PEGASUS_REG_TOOL], "\$(top_srcdir)/gen_pegasus_reg.pl") +AC_SUBST([sfcb_regdir], "\$(sfcb_staging_dir)/regs") +AC_SUBST([test_classlistdir], /etc/cimtest/classlist) +AC_SUBST([pegasus_regdir], /var/pegasus/omc-smash/regs) + +# Set up the locations to place the MOFs +AC_SUBST([sfcb_interop_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(interop_namespace)") +AC_SUBST([sfcb_smash_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(smash_namespace)") +AC_SUBST([sfcb_smash_internal_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(smash_internal_namespace)") +AC_SUBST([sfcb_smash_ipmi_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(smash_ipmi_namespace)") +AC_SUBST([sfcb_smash_smbios_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(smash_smbios_namespace)") + +AC_SUBST([sfcb_schema_dir]) +AC_SUBST([sfcb_registration_dir]) +AC_SUBST([sfcb_staging_dir]) + +AC_SUBST([pegasus_config_nsdir], + "\$(pegasus_regdir)/../mofs/\$(config_namespace)") +AC_SUBST([pegasus_interop_nsdir], + "\$(pegasus_regdir)/../mofs/\$(pegasus_interop_namespace)") +AC_SUBST([pegasus_smash_nsdir], + "\$(pegasus_regdir)/../mofs/\$(smash_namespace)") +AC_SUBST([pegasus_smash_internal_nsdir], + "\$(pegasus_regdir)/../mofs/\$(smash_internal_namespace)") +AC_SUBST([pegasus_smash_ipmi_nsdir], + "\$(pegasus_regdir)/../mofs/\$(smash_ipmi_namespace)") +AC_SUBST([pegasus_smash_smbios_nsdir], + "\$(pegasus_regdir)/../mofs/\$(smash_smbios_namespace)") + +AC_ARG_WITH([pegasus], + [AS_HELP_STRING([--with-pegasus], [Enable support for the pegasus CIMOM])], + [], [with_pegasus=no]) +AM_CONDITIONAL(ENABLE_PEGASUS, test x$with_pegasus != xno) +# End CIMOM specific setup + + debuglevel="0" ####################################################################### # Set the debug flag if specified @@ -110,29 +251,8 @@ ##################################################### -# Checks for libraries. -#AC_CHECK_LIB([owcimomcommon], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owclient], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owcppprovifc], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owdb], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owhttpclient], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owhttpcommon], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owhttpxmllistener], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owprovider], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owrepositoryhdb], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owserver], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owservicehttp], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owwql], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owwqlcommon], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([owxml], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([pthread], [main], [LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -#AC_CHECK_LIB([crypto], [main], [LIBS="$LIBS"], [AC_MSG_ERROR(Must have libcrypto \(openssl-devel\) or build will fail)]) -# Checks for two basic and common openwbem libraries -AC_CHECK_LIB([owcimomcommon], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) -AC_CHECK_LIB([owclient], [main], [LIBS="$LIBS"], [AC_MSG_ERROR(Must have openwbem-devel or build will fail)]) - LIMAL_RUNLEVEL_LIBS=`pkg-config --libs limal-runlevel` AC_SUBST(LIMAL_RUNLEVEL_LIBS) @@ -140,7 +260,7 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([openwbem/OW_config.h fcntl.h stdlib.h string.h unistd.h sys/time.h openssl/evp.h sys/param.h sys/vfs.h],,[AC_MSG_ERROR(Missing headers: likely won't compile)]) +AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h sys/time.h openssl/evp.h sys/param.h ],,[AC_MSG_ERROR(Missing headers: likely won't compile)]) # Only build init.d provider if limal headers are present AC_CHECK_HEADER([limal/runlevel/config.h],[HAVE_LIMAL_RUNLEVEL="1"],[HAVE_LIMAL_RUNLEVEL="0"]) @@ -148,7 +268,10 @@ # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL -AC_C_CONST + +# This doesn't work with -Os +#AC_C_CONST + AC_TYPE_PID_T AC_TYPE_UID_T AC_HEADER_TIME @@ -158,12 +281,13 @@ # Checks for library functions. AC_FUNC_CLOSEDIR_VOID -AC_REPLACE_FNMATCH +#AC_REPLACE_FNMATCH AC_FUNC_FORK AC_FUNC_LSTAT AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK -AC_FUNC_MALLOC -AC_FUNC_REALLOC +# XXX These don't work for cross-compiling +#AC_FUNC_MALLOC +#AC_FUNC_REALLOC AC_FUNC_CHOWN AC_FUNC_SETVBUF_REVERSED AC_FUNC_STAT @@ -171,6 +295,29 @@ AC_CHECK_FUNCS([gettimeofday memset regcomp strchr strdup strerror strstr strtol strtoul uname]) + +AC_PATH_PROG([PERL], [perl], []) +AS_IF([test x$PERL = x], + [AC_MSG_ERROR([Unable to locate perl])] +) + +# Set up CIMOM specific build flags +AC_ARG_WITH([sfcb], + [AS_HELP_STRING([--with-sfcb], [Enable support for the sfcb CIMOM])], + [], [with_sfcb=no]) + +AS_IF([test "x$with_sfcb" != "xno"], + [AC_PATH_PROG([SFCBREPOS], [sfcbrepos], [])] + AS_IF([test x$SFCBREPOS = x], + [AC_MSG_ERROR([Unable to locate sfcbrepos with --enable-sfcb set])] + )) + +AC_ARG_WITH([pegasus], + [AS_HELP_STRING([--with-pegasus], [Enable support for the pegasus CIMOM])], + [], [with_pegasus=no]) +AM_CONDITIONAL(ENABLE_PEGASUS, test x$with_pegasus != xno) + + AC_CONFIG_FILES([Makefile src/Makefile src/lib/Makefile Added: base/branches/cmpi/gen_pegasus_reg.pl =================================================================== --- base/branches/cmpi/gen_pegasus_reg.pl (rev 0) +++ base/branches/cmpi/gen_pegasus_reg.pl 2007-10-05 23:38:08 UTC (rev 500) @@ -0,0 +1,103 @@ +#!/usr/bin/env perl +# Copyright (c) 2007 VMware, Inc. All rights reserved. +# +# This script requires a pre-registration file with the following format +# +# CLASS|PROVIDER_NAME|GROUP_NAME|LIBRARY|PROVIDER_TYPE... +# +# +$line = 0; +$erroCount = 0; + +while (<STDIN>) { + chop; + $origLine = $_; + $line ++; + # Clean up any formatting whitespace + $_ =~ s/\s+//g; + + # Purge any comments + $_ =~ s/#.*$//g; + if ($_ eq "") { + # Just skip blank lines - no need to validate/warn + next; + } + + ($classname, $providerName, $group, $lib, $types) = split(/\|/, $_, 6); + $namespaces = join(", ", @ARGV); + $namespaces =~ s/\s+//g; + + if ($namespaces eq "") { + print STDERR "ERROR: You must specify at least 1 namespace on the command line\n"; + exit (1); + } + + # Ignore lines without valid entries + if ($classname eq "" || $providerName eq "" || $lib eq "" + || $types eq "") { + print STDERR "Error: invalid entry\n"; + print STDERR "$line: \"$origLine\"\n"; + $erroCount ++; + next; + } + if ($erroCount > 0) { + # Don't generate a file, just generate more errors + next; + } + + + $pegTypeList = ""; + $types =~ s/\s+//g; + foreach $type (split(/,/, $types)) { + if($type eq "instance") { + $pegTypeList .= "2,"; + } elsif ($type eq "association") { + $pegTypeList .= "3,"; + } elsif ($type eq "indication") { + $pegTypeList .= "4,"; + } elsif ($type eq "method") { + $pegTypeList .= "5,"; + } else { + print STDERR "Unrecognized provider type($type) for $classname - types=\"$types\"\n"; + exit 1; + } + } + chop($pegTypeList); + $types =~ s/\s+//g; + + $pegNamespaceList = "\"" . $namespaces . "\""; + $pegNamespaceList =~ s/,/\", \"/g; + + # First spit out the .mof file + print << "EOF"; +instance of PG_ProviderModule +{ + Description = \"$providerName\"; + Caption = \"$providerName\"; + Name = \"$providerName\"; + Vendor = \"VMware\"; + Version = \"2.0.0\"; + InterfaceType = \"CMPI\"; + InterfaceVersion = \"2.0.0\"; + Location = \"$lib\"; +}; +instance of PG_Provider +{ + ProviderModuleName = \"$providerName\"; + Name = \"$providerName\"; +}; +instance of PG_ProviderCapabilities +{ + ProviderModuleName = \"$providerName\"; + ProviderName = \"$providerName\"; + CapabilityID = \"$classname\"; + ClassName = \"$classname\"; + Namespaces = { $pegNamespaceList }; +EOF + print " ProviderType = { "; + print "$pegTypeList };\n};\n"; + +} + +exit ($erroCount); + Property changes on: base/branches/cmpi/gen_pegasus_reg.pl ___________________________________________________________________ Name: svn:executable + * Added: base/branches/cmpi/gen_sfcb_cls.pl =================================================================== --- base/branches/cmpi/gen_sfcb_cls.pl (rev 0) +++ base/branches/cmpi/gen_sfcb_cls.pl 2007-10-05 23:38:08 UTC (rev 500) @@ -0,0 +1,57 @@ +#!/usr/bin/env perl +# Copyright (c) 2007 VMware, Inc. All rights reserved. +# +# This script requires a pre-registration file with the following format +# +# CLASS|PROVIDER_NAME|GROUP_NAME|LIBRARY|PROVIDER_TYPE... +# +# +$line = 0; +$erroCount = 0; + +while (<STDIN>) { + chop; + $origLine = $_; + $line ++; + # Clean up any formatting whitespace + $_ =~ s/\s+//g; + + # Purge any comments + $_ =~ s/#.*$//g; + if ($_ eq "") { + # Just skip blank lines - no need to validate/warn + next; + } + + ($classname, $providerName, $group, $lib, $types) = split(/\|/, $_, 6); + $namespaces = join(" ", @ARGV); + + if ($namespaces eq "") { + print STDERR "ERROR: You must specify at least 1 namespace on the command line\n"; + exit (1); + } + + # Ignore lines without valid entries + if ($classname eq "" || $providerName eq "" || $lib eq "" + || $types eq "") { + print STDERR "Error: invalid entry\n"; + print STDERR "$line: \"$origLine\"\n"; + $erroCount ++; + next; + } + if ($erroCount > 0) { + # Don't generate a file, just generate more errors + next; + } + + $regTypeList = ""; + $types =~ s/\s+//g; + foreach $type (split(/,/, $types)) { + if($type eq "instance") { + print "$classname | $namespaces\n"; + } + } + chop($regTypeList); +} + +exit ($erroCount); Property changes on: base/branches/cmpi/gen_sfcb_cls.pl ___________________________________________________________________ Name: svn:executable + * Added: base/branches/cmpi/gen_sfcb_reg.pl =================================================================== --- base/branches/cmpi/gen_sfcb_reg.pl (rev 0) +++ base/branches/cmpi/gen_sfcb_reg.pl 2007-10-05 23:38:08 UTC (rev 500) @@ -0,0 +1,74 @@ +#!/usr/bin/env perl +# Copyright (c) 2007 VMware, Inc. All rights reserved. +# +# This script requires a pre-registration file with the following format +# +# CLASS|PROVIDER_NAME|GROUP_NAME|LIBRARY|PROVIDER_TYPE... +# +# +$line = 0; +$erroCount = 0; + +while (<STDIN>) { + chop; + $origLine = $_; + $line ++; + # Clean up any formatting whitespace + $_ =~ s/\s+//g; + + # Purge any comments + $_ =~ s/#.*$//g; + if ($_ eq "") { + # Just skip blank lines - no need to validate/warn + next; + } + + ($classname, $providerName, $group, $lib, $types) = split(/\|/, $_, 6); + $namespaces = join(" ", @ARGV); + + if ($namespaces eq "") { + print STDERR "ERROR: You must specify at least 1 namespace on the command line\n"; + exit (1); + } + + # Ignore lines without valid entries + if ($classname eq "" || $providerName eq "" || $lib eq "" + || $types eq "") { + print STDERR "Error: invalid entry\n"; + print STDERR "$line: \"$origLine\"\n"; + $erroCount ++; + next; + } + if ($erroCount > 0) { + # Don't generate a file, just generate more errors + next; + } + + $regTypeList = ""; + $types =~ s/\s+//g; + foreach $type (split(/,/, $types)) { + if($type eq "instance") { + $regTypeList .= "instance "; + } elsif ($type eq "association") { + $regTypeList .= "association "; + } elsif ($type eq "indication") { + $regTypeList .= "indication "; + } elsif ($type eq "method") { + $regTypeList .= "method "; + }else { + print STDERR "Unrecognized provider type($type) for $classname - types=\"$types\""; + exit 1; + } + } + chop($regTypeList); + + # spit out the .reg file + print "[$classname]\n"; + print " provider: $providerName\n"; + print " location: $lib\n"; + print " type: $regTypeList\n"; + print " group: $group\n"; + print " namespace: $namespaces\n\n"; +} + +exit ($erroCount); Property changes on: base/branches/cmpi/gen_sfcb_reg.pl ___________________________________________________________________ Name: svn:executable + * Added: base/branches/cmpi/src/include/omc/AtomicOps.hpp =================================================================== --- base/branches/cmpi/src/include/omc/AtomicOps.hpp (rev 0) +++ base/branches/cmpi/src/include/omc/AtomicOps.hpp 2007-10-05 23:38:08 UTC (rev 500) @@ -0,0 +1,270 @@ +/******************************************************************************* + * Copyright (C) 2001-2004 Vintela, Inc. All rights reserved. + * Copyright (c) 2007 VMware, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * - Neither the name of Vintela, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Vintela, Inc. OR THE CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +/** + * @author Dan Nuffer + * + * Imported from OpenWBEM OW_AtomicOps.hpp + */ + +#ifndef OMC_ATOMIC_OPS_HPP_ +#define OMC_ATOMIC_OPS_HPP_ +#include "config.h" + +#if defined(OMC_AIX) +extern "C" +{ +#include <sys/atomic_op.h> +} +#endif + +// The classes and functions defined in this file are not meant for general +// use, they are internal implementation details. They may change at any time. + +// x86 and x86-64 asm is identical +#if (defined(OMC_ARCH_X86) || defined(__i386__) || defined(OMC_ARCH_X86_64) || defined(__x86_64__)) && defined(__GNUC__) + +namespace OMC +{ + +// use fast inline assembly versions +struct Atomic_t +{ + Atomic_t() : val(0) {} + Atomic_t(int i) : val(i) {} + volatile int val; +}; +inline void AtomicInc(Atomic_t &v) +{ + __asm__ __volatile__( + "lock ; " "incl %0" + :"=m" (v.val) + :"m" (v.val)); +} +inline bool AtomicDecAndTest(Atomic_t &v) +{ + unsigned char c; + __asm__ __volatile__( + "lock ; " "decl %0; sete %1" + :"=m" (v.val), "=qm" (c) + :"m" (v.val) : "memory"); + return c != 0; +} +inline int AtomicGet(Atomic_t const &v) +{ + return v.val; +} +inline void AtomicDec(Atomic_t &v) +{ + __asm__ __volatile__( + "lock ; " "decl %0" + :"=m" (v.val) + :"m" (v.val)); +} + +} // end namespace OMC + +#elif defined(OMC_AIX) +namespace OMC +{ +// This comment was stolen from the libstdc++ implementation of atomicity.h +// (and modified). +// We cannot use the inline assembly for powerpc, since definitions for +// these operations since they depend on operations that are not available on +// the original POWER architecture. AIX still runs on the POWER architecture, +// so it would be incorrect to assume the existence of these instructions. +// +// The definition of Atomic_t.val must match the type pointed to by atomic_p in +// <sys/atomic_op.h>. +struct Atomic_t +{ + Atomic_t() : val(0) {} + Atomic_t(int i) : val(i) {} + volatile int val; +}; + +inline void AtomicInc(Atomic_t &v) +{ + ::fetch_and_add(const_cast<atomic_p>(&v.val), 1); +} +inline bool AtomicDecAndTest(Atomic_t &v) +{ + // fetch_and_add returns the original value before the add operation. Thus, + // we must subtract one from the returned value before comparing. + int c = ::fetch_and_add(const_cast<atomic_p>(&v.val), -1); + --c; + return c == 0; +} +inline int AtomicGet(Atomic_t const &v) +{ + int c = ::fetch_and_add(const_cast<atomic_p>(&v.val), 0); + return c; +} +inline void AtomicDec(Atomic_t &v) +{ + ::fetch_and_add(const_cast<atomic_p>(&v.val), -1); +} + +} // end namespace OMC + +#elif (defined(OMC_ARCH_PPC) || defined(__ppc__)) && defined(__GNUC__) + +namespace OMC +{ + +// use fast inline assembly versions +struct Atomic_t +{ + Atomic_t() : val(0) {} + Atomic_t(int i) : val(i) {} + volatile int val; +}; + +inline void AtomicInc(Atomic_t &v) +{ + int t; + __asm__ __volatile__( + "1: lwarx %0,0,%2\n" + " addic %0,%0,1\n" + " stwcx. %0,0,%2\n" + " bne- 1b" + : "=&r" (t), "=m" (v.val) + : "r" (&v.val), "m" (v.val) + : "cc"); +} +inline bool AtomicDecAndTest(Atomic_t &v) +{ + int c; + __asm__ __volatile__( + "1: lwarx %0,0,%1\n" + " addic %0,%0,-1\n" + " stwcx. %0,0,%1\n" + " bne- 1b\n" + " isync" + : "=&r" (c) + : "r" (&v.val) + : "cc", "memory"); + return c == 0; +} +inline int AtomicGet(Atomic_t const &v) +{ + return v.val; +} +inline void AtomicDec(Atomic_t &v) +{ + int c; + __asm__ __volatile__( + "1: lwarx %0,0,%2\n" + " addic %0,%0,-1\n" + " stwcx. %0,0,%2\n" + " bne- 1b" + : "=&r" (c), "=m" (v.val) + : "r" (&v.val), "m" (v.val) + : "cc"); +} + +} // end namespace OMC + +#elif defined(OMC_WIN32) + +namespace OMC +{ + +// use fast inline assembly versions +struct OMC_COMMON_API Atomic_t +{ + Atomic_t() : val(0) {} + Atomic_t(int i) : val(i) {} + volatile LONG val; +}; +inline void AtomicInc(Atomic_t &v) +{ + InterlockedIncrement(&v.val); +} +inline bool AtomicDecAndTest(Atomic_t &v) +{ + return InterlockedDecrement(&v.val) == 0; +} +inline int AtomicGet(Atomic_t const &v) +{ + return v.val; +} +inline void AtomicDec(Atomic_t &v) +{ + InterlockedDecrement(&v.val); +} + +} // end namespace OMC + +#elif defined(OMC_HAVE_PTHREAD_SPIN_LOCK) +#include <pthread.h> + +#define OMC_USE_PTHREAD_SPIN_LOCK_ATOMIC_OPS // used in OMC_AtomicOps.cpp + +namespace OMC +{ + +struct Atomic_t +{ + Atomic_t(); + Atomic_t(int i); + int val; + pthread_spinlock_t spinlock; +}; +void AtomicInc(Atomic_t &v); +bool AtomicDecAndTest(Atomic_t &v); +int AtomicGet(Atomic_t const &v); +void AtomicDec(Atomic_t &v); + +} // end namespace OMC + +#else +// use slow mutex protected versions +#define OMC_USE_OMC_DEFAULT_ATOMIC_OPS // used in OMC_AtomicOps.cpp + +namespace OMC +{ + +struct Atomic_t +{ + Atomic_t() : val(0) {} + Atomic_t(int i) : val(i) {} + volatile int val; +}; +void AtomicInc(Atomic_t &v); +bool AtomicDecAndTest(Atomic_t &v); +int AtomicGet(Atomic_t const &v); +void AtomicDec(Atomic_t &v); + +} // end namespace OMC + +#endif +#endif Modified: base/branches/cmpi/src/include/omc/Base.hpp =================================================================== --- base/branches/cmpi/src/include/omc/Base.hpp 2007-10-05 23:20:20 UTC (rev 499) +++ base/branches/cmpi/src/include/omc/Base.hpp 2007-10-05 23:38:08 UTC (rev 500) @@ -1,5 +1,6 @@ /******************************************************************************* * Copyright (C) 2005, 2006 Novell, Inc. All rights reserved. +* Copyright (c) 2007 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,13 +31,47 @@ // Author: Jon Carey (jc...@no...) -#ifndef __LINUX_COMMON_HPP__ -#define __LINUX_COMMON_HPP__ +#ifndef __OMC_BASE_HPP__ +#define __OMC_BASE_HPP__ -#include <openwbem/OW_String.hpp> -#include <openwbem/OW_CIMDateTime.hpp> -#include <openwbem/OW_CIMObjectPath.hpp> +#include <cmpi/CmpiObjectPath.h> +#include <cmpi/CmpiDateTime.h> +#include <syslog.h> +#include <string> +#include <vector> +#define OMC_LOG_VERBOSE (0) + +#ifdef DEBUG +#define OMC_LOG_DEBUG(args...) \ + syslog(LOG_INFO, args) + +#define OMC_LOG_INFO(args...) \ + syslog(LOG_INFO, args) +#else +#define OMC_LOG_DEBUG(args...) + +#define OMC_LOG_INFO(args...) +#endif + +#define OMC_LOG_NOTICE(args...) \ + syslog(LOG_NOTICE, args) + +#define OMC_LOG_WARNING(args...) \ + syslog(LOG_WARNING, args) + +#define OMC_LOG_ERROR(args...) \ + syslog(LOG_ERR, args) + +#define OMC_LOG_CRIT(args...) \ + syslog(LOG_CRIT, args) + +#define OMC_LOG_ALERT(args...) \ + syslog(LOG_ALERT, args) + +#define OMC_LOG_EMERG(args...) \ + syslog(LOG_EMERG, args) + namespace OMC { @@ -45,30 +80,37 @@ * @return A string that contains the class name that should be used * in OSCreationClassName properties. */ -OpenWBEM::String getOperatingSystemClassName(); +std::string getOperatingSystemClassName(); /** * Get the class name that represents the ComputerSystem. * @return A string that contains the class name that should be used * in CSCreationClassName properties. */ -OpenWBEM::String getComputerSystemClassName(); +std::string getComputerSystemClassName(); /** - * Get the common value used for the computer system. + * Get the name for computer system using up-call to the broker + * @param ctx context + * @param broker pointer to broker to make up-call * @return A string that contains the computer system name. To be * used in values of the CSName property. */ -OpenWBEM::String getComputerSystemName(); +std::string getComputerSystemName( + const CmpiContext& ctx, const CmpiBroker* broker); +std::string getComputerSystemName( + const CmpiContext& ctx, CmpiBroker* broker); /** * Get the object path of the OMC_UnitaryComputerSystem * object. * @param ns The name space for the object. + * @param ctx context + * @param broker pointer to broker to make up-call * @return The object path for the computer system object. */ -OpenWBEM::CIMObjectPath getComputerSystemObjectPath( - const OpenWBEM::String& ns); +CmpiObjectPath getComputerSystemObjectPath( + const std::string& ns, const CmpiContext& ctx, CmpiBroker* broker); /** @@ -77,9 +119,10 @@ * @param ns The name space for the object. * @return The object path for the computer system object. */ -OpenWBEM::CIMObjectPath getOperatingSystemObjectPath( - const OpenWBEM::String& ns); +CmpiObjectPath getOperatingSystemObjectPath( + const std::string& ns); +#if (0 && __VMWARE__) /** * Determine if an object path points to the computer @@ -90,15 +133,16 @@ * system object. Otherwise false. */ bool isComputerSystemObjectPath( - const OpenWBEM::String& ns, - const OpenWBEM::CIMObjectPath& cop); + const std::string& ns, + const CmpiObjectPath& cop); +#endif /** * Get the common value used for the operating system. * @return A string that contains the OS name. To be used in values * of the OSName property. */ -OpenWBEM::String getOperatingSystemName(); +std::string getOperatingSystemName(); /** * Generate an instance id that has a prefix that is consistent @@ -110,8 +154,9 @@ * @parm uniqueParm The unique part of the final instance id. * @return The instance id that will be used for a key value. */ -OpenWBEM::String makeInstanceID(const OpenWBEM::String& uniquePart); +std::string makeInstanceID(const std::string& uniquePart); +#if (0 && __VMWARE__) /** * Get the install date of an RPM as a CIMDateTime. * @param rpmName The name of the rpm to get the install date for. @@ -121,21 +166,25 @@ * of the given rpm on success. Otherwise a NULL CIMDateTime * object will be returned. */ -OpenWBEM::CIMDateTime getRPMInstallDate( - const OpenWBEM::String& rpmName, +CmpiDateTime getRPMInstallDate( + const std::string& rpmName, int *pExitStatus=NULL); +#endif - /** * Get the name of the interop namespace * @return A string that contains the name of the interop namespace * */ -OpenWBEM::String getInteropNamespaceName(); +std::string getInteropNamespaceName(); #define OMC_REG_PROV_EXPLICITLY_opt "omc.register_explicitly" -} // End of namespace OMC -#endif // __LINUX_COMMON_HPP__ +void tokenize(const std::string &str, std::vector<std::string> &tokens, + const std::string &delim); + +} // End of namespace OMC + +#endif // __OMC_BASE_HPP__ Added: base/branches/cmpi/src/include/omc/CmpiUtils.hpp =================================================================== --- base/branches/cmpi/src/include/omc/CmpiUtils.hpp (rev 0) +++ base/branches/cmpi/src/include/omc/CmpiUtils.hpp 2007-10-05 23:38:08 UTC (rev 500) @@ -0,0 +1,54 @@ +/*********************************************************** + * Copyright (c) 2007 VMware, Inc. All rights reserved. + * + * CmpiUtils.hpp + * + ***********************************************************/ + +#ifndef __OMC_CMPIUTILS_HPP__ +#define __OMC_CMPIUTILS_HPP__ + + +#include <cmpi/CmpiData.h> +#include <cmpi/CmpiInstance.h> +#include <cmpi/CmpiObjectPath.h> + +namespace OMC +{ + +void copyPropertyValue(const char *propName, const CmpiInstance& src, CmpiInstance& dest); +void copyPropertyValue(const char *srcProp, const CmpiInstance& src, + const char *destProp, CmpiInstance& dest); + +template<class T> +static inline bool +getPropertyValue(const CmpiInstance& ci, const char *propName, T& dest) +{ + CmpiData cv = ci.getProperty(propName); + if (cv.isNotFound() || cv.isNullValue()) + { + return false; + } + dest = cv; + return true; +} + + +template<class T> +static inline bool +getKeyValue(const CmpiObjectPath& cop, const char *propName, T& dest) +{ + CmpiData cv = cop.getKey(propName); + if (cv.isNotFound() || cv.isNullValue()) + { + return false; + } + dest = cv; + return true; +} + + + +} + +#endif // __OMC_CMPIUTILS_HPP__ Modified: base/branches/cmpi/src/include/omc/Makefile.am =================================================================== --- base/branches/cmpi/src/include/omc/Makefile.am 2007-10-05 23:20:20 UTC (rev 499) +++ base/branches/cmpi/src/include/omc/Makefile.am 2007-10-05 23:38:08 UTC (rev 500) @@ -4,10 +4,17 @@ pkginclude_HEADERS = \ CIMUtils.hpp \ Base.hpp \ + Reference.hpp \ + ReferenceBase.hpp \ + RefCount.hpp \ + AtomicOps.hpp \ + Sync.hpp \ LinuxProcess.hpp \ FileTools.hpp \ FileDefs.hpp \ FileFilter.hpp \ - ProviderStore.hpp + ProviderStore.hpp \ + SimpleAssociationMI.hpp \ + CmpiUtils.hpp Modified: base/branches/cmpi/src/include/omc/ProviderStore.hpp =================================================================== --- base/branches/cmpi/src/include/omc/ProviderStore.hpp 2007-10-05 23:20:20 UTC (rev 499) +++ base/branches/cmpi/src/include/omc/ProviderStore.hpp 2007-10-05 23:38:08 UTC (rev 500) @@ -1,5 +1,6 @@ /******************************************************************************* * Copyright (C) 2005, 2006 Novell, Inc. All rights reserved. +* Copyright (c) 2007 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,11 +34,9 @@ #ifndef PROVIDERSTORE_HPP_GUARD #define PROVIDERSTORE_HPP_GUARD -#include <openwbem/OW_String.hpp> -#include <openwbem/OW_CIMObjectPath.hpp> -#include <openwbem/OW_Map.hpp> -#include <openwbem/OW_CIMException.hpp> -#include <openwbem/OW_ProviderEnvironmentIFC.hpp> +#include <cmpi/CmpiBroker.h> +#include <cmpi/CmpiObjectPath.h> +#include <map> extern "C" { @@ -47,20 +46,18 @@ namespace OMC { -using namespace OW_NAMESPACE; -OW_DECLARE_EXCEPTION(ProviderStore); // Compare to create a case insensative string map struct ProviderStorePropsCompare { - bool operator()(const String& k1, const String& k2) + bool operator()(const std::string& k1, const std::string& k2) { return ::strcasecmp(k1.c_str(), k2.c_str()) < 0; } }; -typedef Map<String, String, ProviderStorePropsCompare> ProviderStoreProps; +typedef std::map<std::string, std::string, ProviderStorePropsCompare> ProviderStoreProps; /** * The ProviderStore class is a set of static methods that handle the storage @@ -69,18 +66,18 @@ * The intention is for the stored data to correspond with an instance in * another namespace that a provider is instrumenting in. Thus the stored * data is keyed off of the namespace of the caller plus the class name - * and any keys associated with the instance in the form of a CIMObjectPath. + * and any keys associated with the instance in the form of a CmpiObjectPath. */ class ProviderStore { public: /** * Store some properties for an instance that resides in a given namespace. - * @param env A ProviderEnvironmentIFCRef that the store procedure + * @param broker A CmpiBroker that the store procedure * will use to process the given request. * @param ns The namespace for the instance that this data is being * store for. - * @param key The CIMObjectPath that references the instance this data + * @param key The CmpiObjectPath that references the instance this data * is being stored for. * @param props The Properties and Values to be stored for the instance * referenced by the 'key' param. @@ -88,18 +85,19 @@ * Throws CIMException if some failure was encountered with the CIMOM. */ static void storeProps( - const ProviderEnvironmentIFCRef& env, - const String& ns, - const CIMObjectPath& key, + CmpiContext& ctx, + CmpiBroker& broker, + const std::string& ns, + const CmpiObjectPath& key, const ProviderStoreProps& props); /** * Get some properties for an instance that resides in a given namespace. - * @param env A ProviderEnvironmentIFCRef that the get procedure + * @param broker A CmpiBroker that the get procedure * will use to process the given request. * @param ns The namespace for the instance that this data is being * retrieved for. - * @param key The CIMObjectPath that references the instance this data + * @param key The CmpiObjectPath that references the instance this data * is being retrieved for. * @return A ProviderStoreProps object that contains the properties and * values that were previously stored for the given instance. @@ -107,9 +105,10 @@ * Throws CIMException if some failure was encountered with the CIMOM. */ static ProviderStoreProps getProps( - const ProviderEnvironmentIFCRef& env, - const String& ns, - const CIMObjectPath& key); + CmpiContext& ctx, + CmpiBroker& broker, + const std::string& ns, + const CmpiObjectPath& key); private: ProviderStore() {} // Forbid creation of instances }; Added: base/branches/cmpi/src/include/omc/RefCount.hpp =================================================================== --- base/branches/cmpi/src/include/omc/RefCount.hpp (rev 0) +++ base/branches/cmpi/src/include/omc/RefCount.hpp 2007-10-05 23:38:08 UTC (rev 500) @@ -0,0 +1,79 @@ +/******************************************************************************* + * Copyright (C) 2001-2004 Vintela, Inc. All rights reserved. + * Copyright (c) 2007 VMware, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * - Neither the name of Vintela, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Vintela, Inc. OR THE CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + ******************************************************************************/ + +/** + * @author Dan Nuffer + * + * Imported from OpenWBEM OW_RefCount.hpp + */ + +#ifndef OMC_REF_COUNT_HPP_ +#define OMC_REF_COUNT_HPP_ +#include "config.h" +#include "AtomicOps.hpp" + +// The classes and functions defined in this file are not meant for general +// use, they are internal implementation details. They may change at any time. + +namespace OMC +{ + +////////////////////////////////////////////////////////////////////////////// +class RefCount +{ +public: + RefCount() + : m_count(1) + { + } + RefCount(Atomic_t c) + : m_count(c) + { + } + void inc() + { + AtomicInc(m_count); + } + bool decAndTest() + { + return AtomicDecAndTest(m_count); + } + int get() const + { + return AtomicGet(m_count); + } +private: + Atomic_t m_count; +}; + +} // end namespace OMC + +#endif Added: base/branches/cmpi/src/include/omc/Reference.hpp =================================================================== --- base/branches/cmpi/src/include/omc/Reference.hpp (rev 0) +++ base/branches/cmpi/src/include/omc/Reference.hpp 2007-10-05 23:38:08 UTC (rev 500) @@ -0,0 +1,244 @@ +/******************************************************************************* + * Copyright (C) 2001-2004 Vintela, Inc. All rights reserved. + * Copyright (c) 2007 VMware, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * - Neither the name of Vintela, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Vintela, Inc. OR THE CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *******************************************************************************/ + +/** + * @author Jon Carey + * @author Dan Nuffer + * + * Imported from OpenWBEM OW_Reference.hpp + */ + +#ifndef OMC_REFERENCE_HPP_ +#define OMC_REFERENCE_HPP_ +#include "config.h" +#include "ReferenceBase.hpp" + +namespace OMC +{ + +////////////////////////////////////////////////////////////////////////////// +template<class T> +class Reference : +#if !defined(__GNUC__) || __GNUC__ > 2 // because of a gcc 2.95 ICE + private ReferenceBase +#else + public ReferenceBase +#endif +{ + public: + typedef T element_type; + + Reference(); + explicit Reference(T* ptr); + Reference(const Reference<T>& arg); + + /* construct out of a reference to a derived type. U should be + derived from T */ + template <class U> + Reference(const Reference<U>& arg); + ~Reference(); + Reference<T>& operator= (const Reference<T>& arg); + Reference<T>& operator= (T* newObj); + void swap(Reference<T>& arg); + T* operator->() const; + T& operator*() const; + T* getPtr() const; + bool isNull() const; // in 3.1.0 OMC_DEPRECATED + typedef T* volatile Reference::*safe_bool; + operator safe_bool () const + { return (m_pObj ? &Reference::m_pObj : 0); } + bool operator!() const + { return !m_pObj; } + template <class U> + Reference<U> cast_to() const; + template <class U> + void useRefCountOf(const Reference<U>&); +#if !defined(__GNUC__) || __GNUC__ > 2 // causes gcc 2.95 to ICE + /* This is so the templated constructor will work */ + template <class U> friend class Reference; + private: +#endif + void decRef(); + T* volatile m_pObj; +}; +////////////////////////////////////////////////////////////////////////////// +template<class T> +inline Reference<T>::Reference() + : ReferenceBase(), m_pObj(0) +{ +} +////////////////////////////////////////////////////////////////////////////// +template<class T> +inline Reference<T>::Reference(T* ptr) + : ReferenceBase(), m_pObj(ptr) +{ +} +////////////////////////////////////////////////////////////////////////////// +template<class T> +inline Reference<T>::Reference(const Reference<T>& arg) + : ReferenceBase(arg), m_pObj(arg.m_pObj) +{ +} +////////////////////////////////////////////////////////////////////////////// +template<class T> +template<class U> +inline Reference<T>::Reference(const Reference<U>& arg) + : ReferenceBase(arg), + m_pObj(arg.m_pObj) +{ +} +////////////////////////////////////////////////////////////////////////////// +template<class T> +inline Reference<T>::~Reference() +{ + // we don't catch(...) here because nothing we do will throw, and any + // class we wrap should have a non-throwing destructor. + decRef(); +} +////////////////////////////////////////////////////////////////////////////// +template<class T> +inline void Reference<T>::decRef() +{ + typedef char type_must_be_complete[sizeof(T)]; + if (ReferenceBase::decRef()) + { + delete m_pObj; + } +} +////////////////////////////////////////////////////////////////////////////// +template<class T> +inline Reference<T>& Reference<T>::operator= (const Reference<T>& arg) +{ + Reference<T>(arg).swap(*this); + return *this; +} +////////////////////////////////////////////////////////////////////////////// +template<class T> +inline Reference<T>& Reference<T>::operator= (T* newObj) +{ + Reference<T>(newObj).swap(*this); + return *this; +} +////////////////////////////////////////////////////////////////////////////// +template <class T> +inline void Reference<T>::swap(Reference<T>& arg) +{ + ReferenceBase::swap(arg); + RefSwap(m_pObj, arg.m_pObj); +} +////////////////////////////////////////////////////////////////////////////// +template<class T> +inline T* Reference<T>::operator->() const +{ +#ifdef OMC_CHECK_NULL_REFERENCES + checkNull(this); + checkNull(m_pObj); +#endif + + return m_pObj; +} +////////////////////////////////////////////////////////////////////////////// +template<class T> +inline T& Reference<T>::operator*() const +{ +#ifdef OMC_CHECK_NULL_REFERENCES + checkNull(this); + checkNull(m_pObj); +#endif + + return *(m_pObj); +} +////////////////////////////////////////////////////////////////////////////// +template<class T> +inline T* Reference<T>::getPtr() const +{ + return m_pObj; +} +////////////////////////////////////////////////////////////////////////////// +template<class T> +inline bool Reference<T>::isNull() const +{ + return (m_pObj == 0); +} +////////////////////////////////////////////////////////////////////////////// +template <class T> +template <class U> +inline Reference<U> +Reference<T>::cast_to() const +{ + Reference<U> rval; + rval.m_pObj = dynamic_cast<U*>(m_pObj); + if (rval.m_pObj) + { + rval.useRefCountOf(*this); + } + return rval; +} +////////////////////////////////////////////////////////////////////////////// +template <class T> +template <class U> +inline void +Reference<T>::useRefCountOf(const Reference<U>& arg) +{ + ReferenceBase::useRefCountOf(arg); +} +////////////////////////////////////////////////////////////////////////////// +// Comparisons +template <class T, class U> +inline bool operator==(const Reference<T>& a, const Reference<U>& b) +{ + return a.getPtr() == b.getPtr(); +} +////////////////////////////////////////////////////////////////////////////// +template <class T, class U> +inline bool operator!=(const Reference<T>& a, const Reference<U>& b) +{ + return a.getPtr() != b.getPtr(); +} +////////////////////////////////////////////////////////////////////////////// +#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 +// Resolve the ambiguity between our op!= and the one in rel_ops +template <class T> +inline bool operator!=(const Reference<T>& a, const Reference<T>& b) +{ + return a.getPtr() != b.getPtr(); +} +#endif +////////////////////////////////////////////////////////////////////////////// +template <class T, class U> +inline bool operator<(const Reference<T>& a, const Reference<U>& b) +{ + return a.getPtr() < b.getPtr(); +} + +} // end namespace OMC + +#endif // OMC_REFERENCE_HPP_ Added: base/branches/cmpi/src/include/omc/ReferenceBase.hpp =================================================================== --- base/branches/cmpi/src/include/omc/ReferenceBase.hpp (rev 0) +++ base/branches/cmpi/src/include/omc/ReferenceBase.hpp 2007-10-05 23:38:08 UTC (rev 500) @@ -0,0 +1,122 @@ +/******************************************************************************* + * Copyright (C) 2003-2004 Vintela, Inc. All rights reserved. + * Copyright (c) 2007 VMware, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * - Neither the name of Vintela, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL Vintela, Inc. OR THE CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *******************************************************************************/ + +/** + * @author Dan Nuffer + * + * Imported from OpenWBEM OW_ReferenceBase.hpp + */ + +#ifndef OMC_REFERENCE_BASE_HPP_INCLUDE_GUARD_ +#define OMC_REFERENCE_BASE_HPP_INCLUDE_GUARD_ +#include "config.h" +#include "RefCount.hpp" + +// The classes and functions defined in this file are not meant for general +// use, they are internal implementation details. They may change at any time. + +namespace OMC +{ + +////////////////////////////////////////////////////////////////////////////// +template<class T> +inline void RefSwap(T& x, T&y) +{ + T t = x; + x = y; + y = t; +} +////////////////////////////////////////////////////////////////////////////// +// This class contains the non-templated code for Reference, to help +// minimize code bloat. +class ReferenceBase +{ +#if !defined(__GNUC__) || __GNUC__ > 2 // because of a gcc 2.95 ICE +protected: +#else +public: +#endif + ReferenceBase() + : m_pRefCount(new RefCount) {} + ReferenceBase(const ReferenceBase& arg) + : m_pRefCount(0) + { + m_pRefCount = arg.m_pRefCount; + m_pRefCount->inc(); + } + void incRef() + { + m_pRefCount->inc(); + } + + bool decRef() + { + if (m_pRefCount->decAndTest()) + { + delete m_pRefCount; + return true; + } + return false; + } + void swap(ReferenceBase& arg) + { + RefSwap(m_pRefCount, arg.m_pRefCount); + } + void useRefCountOf(const ReferenceBase& arg) + { + decRef(); + m_pRefCount = arg.m_pRefCount; + incRef(); + } + +#ifdef OMC_CHECK_NULL_REFERENCES + static void throwNULLException(); + static void checkNull(const void *p) + { + if (p == 0) + { + throwNULLException(); + } + } +#endif + +#if !defined(__GNUC__) || __GNUC__ > 2 // because of a gcc 2.95 ICE +protected: +#else +public: +#endif + RefCount* volatile m_pRefCount; +}; + +} // end namespace OMC + +#endif + Added: base/branches/cmpi/src/include/omc/SimpleAssociationMI.hpp =================================================================== --- base/branches/cmpi/src/include/omc/SimpleAssociationMI.hpp (rev 0) +++ base/branches/cmpi/src/include/omc/SimpleAssociationMI.hpp 2007-10-05 23:38:08 UTC (rev 500) @@ -0,0 +1,177 @@ +/******************************************************************************* +* Copyright (C) 2004 Novell, Inc All rights reserved. +* Copyright (c) 2007 VMware, Inc. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* - Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* - Redistributions in binary form must reproduce the above copyright notice, +* this list of conditions and the following disclaimer in the documentation +* and/or other materials provided with the distribution. +* +* - Neither the name of Novell nor the names of its +* contributors may be used to endorse or promote products derived from this +* software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc OR THE CONTRIBUTORS +* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +* POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +/* + * Derived for CMPI from the OpenWBEM CppSimpleAssocoatorProviderIFC + */ + +/** + * @author Bart Whiteley + */ + + +#ifndef OMC_SIMPLE_ASSOCIATION_MI +#define OMC_SIMPLE_ASSOCIATION_MI + +#include <cmpi/CmpiAssociationMI.h> +#include <cmpi/CmpiObjectPath.h> +#include <cmpi/CmpiContext.h> +#include <cmpi/CmpiResult.h> + + +namespace OMC +{ +/** + * class CppSimpleAssociatorProviderIFC + * The intent of this class is to simplify the writing of Associator + * Providers. Instead of implementing four functions (referneceNames, + * references, associators, associatorNames), you just have to implement + * one: doReferences(). doReferences() is a modified version of references. + * This base class does the work of providing the CIMOM with the four + * original functions based on what is returned from doReferences. + */ +class SimpleAssociationMI : public CmpiAssociationMI +{ +protected: + +/** + * This method is invoked in order to do the Associators, AssociatorNames, + * References, and ReferenceNames operation as + * defined by the CIM operations over HTTP spec at + * http://www.dmtf.org/download/spec/xmls/CIM_HTTP_Mapping10.htm#SecAssociators + * This operation is used to enumerate CIM Instances of a particular + * Association class + * + * @param assocClass Defines the association that the objectName + * object should be associated to. The provider uses this + * information to identify which association must be + * traversed in case it supports more than one + * association. + * + * @param objectName Defines the source CIM Object whose associated + * Objects are to be returned. This is an instance name. + * Instance name (modelpath). + * + * @param resultClass The resultClass input parameter, if not NULL, + * MUST be a valid CIM Class name. It acts as a filter on the + * returned set of Objects by mandating that the resultRole of each + * returned Object MUST be an ObjectPath to either an Instance of this + * Class (or one of its subclasses) or be this Class (or one of its + * subclasses). + * + * @param role The role input parameter, if not NULL, MUST be a + * valid Property name. It acts as a filter on the returned set of + * Objects by mandating that each returned Object MUST be associated + * to the source Object via an Association in which the source Object + * plays the specified role (i.e. the name of the Property in the + * Association Class that refers to the source Object MUST match the + * value of this parameter). + * + * @param resultRole The resultRole input parameter if not NULL, + * MUST be a valid Property name. It acts as a filter on the returned + * set of Objects by mandating that each returned Object MUST contain + * a reference (ObjectPath) to an Instance or Class which is + * associated to the source Object via an Association in which the + * Associated Object plays the specified role (i... [truncated message content] |
From: <dhi...@us...> - 2007-10-05 23:20:17
|
Revision: 499 http://omc.svn.sourceforge.net/omc/?rev=499&view=rev Author: dhiltgen Date: 2007-10-05 16:20:20 -0700 (Fri, 05 Oct 2007) Log Message: ----------- Port a subset of the OMC providers to CMPI API Modified Paths: -------------- schema/branches/cmpi/mof/smash/omc-firmware-inventory-profile.mof schema/branches/cmpi/mof/smash/omc-logical-devices.mof schema/branches/cmpi/mof/smash/omc-physical-asset-profile.mof schema/branches/cmpi/mof/smash/omc-physical-element.mof schema/branches/cmpi/mof/smash/omc-powersupply-profile.mof schema/branches/cmpi/mof/smash/omc-rawipmi.mof schema/branches/cmpi/mof/smash/omc-registered-profile-common.mof schema/branches/cmpi/mof/smash/omc-sensor-profile.mof schema/branches/cmpi/mof/smash/omc-smash-devices.mof schema/branches/cmpi/mof/smash/omc-smash-providers-composite-ns.mof schema/branches/cmpi/mof/smash/omc-smash-providers.mof schema/branches/cmpi/mof/smash/omc-user-group-profile.mof Added Paths: ----------- schema/branches/cmpi/AUTHORS schema/branches/cmpi/ChangeLog schema/branches/cmpi/Makefile.am schema/branches/cmpi/NEWS schema/branches/cmpi/README schema/branches/cmpi/configure.ac schema/branches/cmpi/mof/Makefile.am schema/branches/cmpi/mof/smash/Makefile.am schema/branches/cmpi/mof/smash/omc-smash-internal-schema.mof schema/branches/cmpi/mof/smash/omc-smash-interop-schema.mof schema/branches/cmpi/mof/smash/omc-smash-ipmi-schema.mof schema/branches/cmpi/mof/smash/omc-smash-schema.mof schema/branches/cmpi/mof/smash/omc-smash-smbios-schema.mof schema/branches/cmpi/mof/smash/omc-software.mof Added: schema/branches/cmpi/AUTHORS =================================================================== Added: schema/branches/cmpi/ChangeLog =================================================================== Added: schema/branches/cmpi/Makefile.am =================================================================== --- schema/branches/cmpi/Makefile.am (rev 0) +++ schema/branches/cmpi/Makefile.am 2007-10-05 23:20:20 UTC (rev 499) @@ -0,0 +1,7 @@ +# Copyright (c) 2007 VMware, Inc. All rights reserved. +# + +#AUTOMAKE_OPTIONS = gnu + +SUBDIRS = mof + Added: schema/branches/cmpi/NEWS =================================================================== Added: schema/branches/cmpi/README =================================================================== Added: schema/branches/cmpi/configure.ac =================================================================== --- schema/branches/cmpi/configure.ac (rev 0) +++ schema/branches/cmpi/configure.ac 2007-10-05 23:20:20 UTC (rev 499) @@ -0,0 +1,187 @@ +# Copyright (c) 2007 VMware, Inc. All rights reserved. +# + +AC_PREREQ(2.57) +AC_INIT(omc-schema, 1.0.1) +AM_INIT_AUTOMAKE +#AC_CONFIG_SRCDIR([src]) +AC_CONFIG_HEADER([config.h]) +#AC_PROG_LIBTOOL + +AC_PREFIX_DEFAULT(/usr/local) + + +# Checks for programs. +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET + +AC_PATH_PROG(RM, rm, rm) +AC_PATH_PROG(MV, mv, mv) +AC_PATH_PROG(CP, cp, cp) + +####################################################################### +sfcb_interop_namespace="root/interop" +AC_ARG_WITH(sfcb-interop-namespace, + [ --with-sfcb-interop-namespace=NS Specifiy the namespace for INTEROP specific data. default = root/interop ], + [ + if test "x$withval" != "xno" ; then + sfcb_interop_namespace="$withval" + fi + ] +) +AC_SUBST([sfcb_interop_namespace]) + +pegasus_interop_namespace="root/PG_Interop" +AC_ARG_WITH(pegasus-interop-namespace, + [ --with-pegasus-interop-namespace=NS Specifiy the namespace for INTEROP specific data. default = root/PG_Interop ], + [ + if test "x$withval" != "xno" ; then + pegasus_interop_namespace="$withval" + fi + ] +) +AC_SUBST([pegasus_interop_namespace]) + +####################################################################### +#smash_namespace="smash" # XXX Doesn't work yet +smash_namespace="root/cimv2" +AC_ARG_WITH(smash-namespace, + [ --with-smash-namespace=NS Specifiy the namespace for SMASH specific data. default = smash ], + [ + if test "x$withval" != "xno" ; then + smash_namespace="$withval" + fi + ] +) +AC_SUBST([smash_namespace]) + +####################################################################### +#smash_internal_namespace="smash/internal" # XXX Doesn't work yet +smash_internal_namespace="root/cimv2" +AC_ARG_WITH(smash-internal-namespace, + [ --with-smash-internal-namespace=NS Specifiy the namespace for SMASH internal data. default = smash/internal ], + [ + if test "x$withval" != "xno" ; then + smash_internal_namespace="$withval" + fi + ] +) +AC_SUBST([smash_internal_namespace]) + +####################################################################### +#smash_ipmi_namespace="smash/ipmi" # XXX Doesn't work yet +smash_ipmi_namespace="root/cimv2" +AC_ARG_WITH(smash-ipmi-namespace, + [ --with-smash-ipmi-namespace=NS Specifiy the namespace for SMASH IPMI specific data. default = smash ], + [ + if test "x$withval" != "xno" ; then + smash_ipmi_namespace="$withval" + fi + ] +) +AC_SUBST([smash_ipmi_namespace]) + +####################################################################### +#smash_smbios_namespace="smash/smbios" # XXX Doesn't work yet +smash_smbios_namespace="root/cimv2" +AC_ARG_WITH(smash-smbios-namespace, + [ --with-smash-smbios-namespace=NS Specifiy the namespace for SMASH SMBIOS specific data. default = smash ], + [ + if test "x$withval" != "xno" ; then + smash_smbios_namespace="$withval" + fi + ] +) +AC_SUBST([smash_smbios_namespace]) + +####################################################################### +sfcb_schema_dir="\$(prefix)/share/sfcb/CIM" +AC_ARG_WITH(sfcb-schema-dir, + [ --with-sfcb-schema-dir=PATH Specifiy the directory where the CIM schema results. default = /usr/local/share/sfcb/CIM ], + [ + if test "x$withval" != "xno" ; then + sfcb_schema_dir="$withval" + fi + ] +) +sfcb_staging_dir="\$(prefix)/var/lib/sfcb/stage" +AC_ARG_WITH(sfcb-staging-dir, + [ --with-sfcb-staging-dir=PATH Specifiy the directory where SFCB stages registration and mof files . default = /usr/local/var/lib/sfcb/stage ], + [ + if test "x$withval" != "xno" ; then + sfcb_staging_dir="$withval" + fi + ] +) +sfcb_registration_dir="\$(prefix)/var/lib/sfcb/registration" +AC_ARG_WITH(sfcb-registration-dir, + [ --with-sfcb-registration-dir=PATH Specifiy the directory where SFCB registration files go. default = /usr/local/var/lib/sfcb/registration ], + [ + if test "x$withval" != "xno" ; then + sfcb_registration_dir="$withval" + fi + ] +) + +##################################################### + + +# Set up CIMOM specific build flags +AC_ARG_WITH([sfcb], + [AS_HELP_STRING([--with-sfcb], [Enable support for the sfcb CIMOM])], + [], [with_sfcb=no]) + +AS_IF([test "x$with_sfcb" != "xno"], + [AC_PATH_PROG([SFCBREPOS], [sfcbrepos], [])] + AS_IF([test x$SFCBREPOS = x], + [AC_MSG_ERROR([Unable to locate sfcbrepos with --enable-sfcb set])] + )) +AM_CONDITIONAL(ENABLE_SFCB, test x$with_sfcb != xno) +AC_SUBST([SFCB_REG_TOOL], "\$(top_srcdir)/gen_sfcb_reg.pl") +AC_SUBST([PEGASUS_REG_TOOL], "\$(top_srcdir)/gen_pegasus_reg.pl") +AC_SUBST([sfcb_regdir], "\$(sfcb_staging_dir)/regs") +AC_SUBST([pegasus_regdir], /var/pegasus/omc-smash/regs) + +# Set up the locations to place the MOFs +AC_SUBST([sfcb_interop_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(sfcb_interop_namespace)") +AC_SUBST([sfcb_smash_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(smash_namespace)") +AC_SUBST([sfcb_smash_internal_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(smash_internal_namespace)") +AC_SUBST([sfcb_smash_ipmi_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(smash_ipmi_namespace)") +AC_SUBST([sfcb_smash_smbios_nsdir], + "\$(sfcb_staging_dir)/mofs/\$(smash_smbios_namespace)") + +AC_SUBST([sfcb_schema_dir]) +AC_SUBST([sfcb_registration_dir]) +AC_SUBST([sfcb_staging_dir]) + +AC_SUBST([pegasus_config_nsdir], + "\$(pegasus_regdir)/../mofs/\$(config_namespace)") +AC_SUBST([pegasus_interop_nsdir], + "\$(pegasus_regdir)/../mofs/\$(pegasus_interop_namespace)") +AC_SUBST([pegasus_smash_nsdir], + "\$(pegasus_regdir)/../mofs/\$(smash_namespace)") +AC_SUBST([pegasus_smash_internal_nsdir], + "\$(pegasus_regdir)/../mofs/\$(smash_internal_namespace)") +AC_SUBST([pegasus_smash_ipmi_nsdir], + "\$(pegasus_regdir)/../mofs/\$(smash_ipmi_namespace)") +AC_SUBST([pegasus_smash_smbios_nsdir], + "\$(pegasus_regdir)/../mofs/\$(smash_smbios_namespace)") + +AC_ARG_WITH([pegasus], + [AS_HELP_STRING([--with-pegasus], [Enable support for the pegasus CIMOM])], + [], [with_pegasus=no]) +AM_CONDITIONAL(ENABLE_PEGASUS, test x$with_pegasus != xno) +# End CIMOM specific setup + + +AC_CONFIG_FILES([Makefile + mof/Makefile + mof/smash/Makefile + ]) +AC_OUTPUT + Added: schema/branches/cmpi/mof/Makefile.am =================================================================== --- schema/branches/cmpi/mof/Makefile.am (rev 0) +++ schema/branches/cmpi/mof/Makefile.am 2007-10-05 23:20:20 UTC (rev 499) @@ -0,0 +1,7 @@ +# Copyright (c) 2007 VMware, Inc. All rights reserved. +# + +#AUTOMAKE_OPTIONS = gnu + +SUBDIRS = smash + Added: schema/branches/cmpi/mof/smash/Makefile.am =================================================================== --- schema/branches/cmpi/mof/smash/Makefile.am (rev 0) +++ schema/branches/cmpi/mof/smash/Makefile.am 2007-10-05 23:20:20 UTC (rev 499) @@ -0,0 +1,135 @@ +# Copyright (c) 2007 VMware, Inc. All rights reserved. +# + +# Mof lists mapping to the top-level include mofs. +OMC_SMASH_PROVIDERS_COMPOSITE_NS = \ + omc-physical-element.mof \ + omc-smash-devices.mof \ + omc-logical-devices.mof \ + omc-computer-system-mirror.mof + +OMC_SMASH_PROVIDERS_SCHEMA = \ + omc-registered-profile-common.mof + +OMC_SMASH_PROVIDERS = \ + omc-computer-system-mirror.mof \ + omc-base-server-profile.mof \ + omc-software.mof \ + $(OMC_SMASH_PROVIDERS_COMPOSITE_NS) \ + omc-clp-admin-domain-profile.mof \ + omc-collection.mof \ + omc-physical-element.mof \ + omc-devices-profile.mof \ + omc-sensor-profile.mof \ + omc-fan-profile.mof \ + omc-processor-profile.mof \ + omc-record-log-profile.mof \ + omc-logical-devices.mof \ + omc-bios-element.mof \ + omc-physical-asset-profile.mof \ + omc-powersupply-profile.mof \ + omc-system-memory-profile.mof \ + omc-firmware-inventory-profile.mof \ + omc-system-collections-profile.mof + +OMC_SMASH_PROVIDERS_INTEROP_NS_SCHEMA = \ + omc-registered-profile-common.mof + +OMC_SMASH_PROVIDERS_INTEROP_NS = \ + omc-registered-profile-interop.mof \ + omc-registered-profile-common.mof \ + omc-computer-system-mirror.mof \ + omc-base-server-profile.mof + +OMC_SMASH_PROVIDERS_IPMI_NS = \ + omc-rawipmi.mof + + +# XXX Unused at the moment +# omc-boot-control-profile.mof \ +# omc-dhcp-client-profile.mof \ +# omc-dnsclient-profile.mof \ +# omc-ethernet-port.mof \ +# omc-ip-interface.mof \ +# omc-ssh-service-profile.mof \ +# omc-user-group-profile.mof + +# Mofs with #pragma include lines - unused by SFCB registration +OMC_SMASH_WRAPPERS = \ + omc-smash-providers-interop-ns.mof \ + omc-smash-providers.mof \ + omc-smash-providers-composite-ns.mof + +# XXX These lists should be pruned down to only what is required +SMASH_NS_MOFS_SCHEMA=\ + omc-smash-providers-interop-ns.mof \ + omc-smash-providers.mof \ + omc-smash-providers-composite-ns.mof \ + omc-smash-schema.mof \ + $(OMC_SMASH_PROVIDERS_SCHEMA) + +SMASH_NS_MOFS=\ + $(OMC_SMASH_PROVIDERS) \ + $(OMC_SMASH_PROVIDERS_INTEROP_NS) + +SMASH_INTEROP_NS_MOFS_SCHEMA=\ + omc-smash-providers-interop-ns.mof \ + omc-smash-interop-schema.mof + +SMASH_INTEROP_NS_MOFS=\ + $(OMC_SMASH_PROVIDERS_INTEROP_NS) + +SMASH_IPMI_NS_MOFS_SCHEMA= \ + omc-smash-providers-interop-ns.mof \ + omc-smash-providers.mof \ + omc-smash-providers-composite-ns.mof \ + omc-smash-ipmi-schema.mof \ + $(OMC_SMASH_PROVIDERS_INTEROP_NS_SCHEMA) + +SMASH_IPMI_NS_MOFS= \ + $(OMC_SMASH_PROVIDERS) \ + $(OMC_SMASH_PROVIDERS_IPMI_NS) \ + $(OMC_SMASH_PROVIDERS_INTEROP_NS) + +SMASH_INTERNAL_NS_MOFS= + +# XXX Not ready +# omc-smash-internal-schema.mof \ +# omc-smash-providers-composite-ns.mof \ +# omc-smash-providers.mof \ +# omc-smash-providers-interop-ns.mof \ +# $(OMC_SMASH_PROVIDERS) \ +# $(OMC_SMASH_PROVIDERS_INTEROP_NS) + +SMASH_SMBIOS_NS_MOFS= + +# XXX Not ready +# omc-smash-smbios-schema.mof \ +# omc-smash-providers-composite-ns.mof \ +# omc-smash-providers.mof \ +# omc-smash-providers-interop-ns.mof \ +# $(OMC_SMASH_PROVIDERS) \ +# $(OMC_SMASH_PROVIDERS_INTEROP_NS) + +if ENABLE_SFCB +dist_sfcb_smash_ns_DATA = $(SMASH_NS_MOFS) +dist_sfcb_interop_ns_DATA = $(SMASH_INTEROP_NS_MOFS) +dist_sfcb_smash_ipmi_ns_DATA = $(SMASH_IPMI_NS_MOFS) +dist_sfcb_smash_internal_ns_DATA = $(SMASH_INTERNAL_NS_MOFS) +dist_sfcb_smash_smbios_ns_DATA = $(SMASH_SMBIOS_NS_MOFS) + +install-data-hook: + $(SFCBREPOS) -f \ + -c $(sfcb_schema_dir) \ + -s $(DESTDIR)/$(sfcb_staging_dir) \ + -r $(DESTDIR)/$(sfcb_registration_dir) +endif + +if ENABLE_PEGASUS +dist_pegasus_smash_ns_DATA = $(SMASH_NS_MOFS_SCHEMA) $(SMASH_NS_MOFS) +dist_pegasus_interop_ns_DATA = $(SMASH_INTEROP_NS_MOFS_SCHEMA) $(SMASH_INTEROP_NS_MOFS) +dist_pegasus_smash_ipmi_ns_DATA = $(SMASH_IPMI_NS_MOFS_SCHEMA) $(SMASH_IPMI_NS_MOFS) +dist_pegasus_smash_internal_ns_DATA = $(SMASH_INTERNAL_NS_MOFS_SCHEMA) $(SMASH_INTERNAL_NS_MOFS) +dist_pegasus_smash_smbios_ns_DATA = $(SMASH_SMBIOS_NS_MOFS_SCHEMA) $(SMASH_SMBIOS_NS_MOFS) + +endif Modified: schema/branches/cmpi/mof/smash/omc-firmware-inventory-profile.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-firmware-inventory-profile.mof 2007-10-05 22:12:19 UTC (rev 498) +++ schema/branches/cmpi/mof/smash/omc-firmware-inventory-profile.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -15,11 +15,7 @@ "SoftwareIdentityCollection for installed firmware") ] class OMC_InstalledFirmwareIdentityCollection : CIM_SystemSpecificCollection - // NOTE: This was previously CIM_SoftwareIdentityCollection, but - // that class was removed from the cimv2.14 exp version of the - // schema. All refs to SoftwareIdentityCollection revert back - // to CIM_SystemSpecificCollection -{ +{ }; // ================================================================== @@ -30,10 +26,6 @@ "SoftwareIdentityCollection for available firmware") ] class OMC_AvailableFirmwareIdentityCollection : CIM_SystemSpecificCollection - // NOTE: This was previously CIM_SoftwareIdentityCollection, but - // that class was removed from the cimv2.14 exp version of the - // schema. All refs to SoftwareIdentityCollection revert back - // to CIM_SystemSpecificCollection { }; @@ -46,10 +38,6 @@ "available for remote systems") ] class OMC_ServableFirmwareIdentityCollection : CIM_SystemSpecificCollection - // NOTE: This was previously CIM_SoftwareIdentityCollection, but - // that class was removed from the cimv2.14 exp version of the - // schema. All refs to SoftwareIdentityCollection revert back - // to CIM_SystemSpecificCollection { }; Modified: schema/branches/cmpi/mof/smash/omc-logical-devices.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-logical-devices.mof 2007-10-05 22:12:19 UTC (rev 498) +++ schema/branches/cmpi/mof/smash/omc-logical-devices.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -4,6 +4,7 @@ //#pragma inLine ("Includes/copyright.inc") // Copyright 2005 Novell, Inc // All rights reserved. +// Copyright (c) 2007 VMware, Inc. All rights reserved. // ================================================================== // // ================================================================== @@ -25,23 +26,28 @@ { }; -[ Description ("A logical power supply") ] -class OMC_PowerSupply : CIM_PowerSupply +[ Description ("The IP protocol endpoint for the BMC") ] +class OMC_IPMIIPProtocolEndpoint : CIM_IPProtocolEndpoint { }; -[ Description ("A logical battery") ] -class OMC_Battery : CIM_Battery +[ Association, Description ("Relation between BMC CS instance and IPProtocolEndpoint.") ] +class OMC_IPMIHostedIPProtocolEndpointAccessPoint : CIM_HostedAccessPoint { + [Override("Antecedent")] + OMC_IPMISubSystem REF Antecedent; + + [Override("Dependent") ] + OMC_IPMIIPProtocolEndpoint REF Dependent; }; -[ Description ("System software") ] -class OMC_SMASHSoftwareIdentity : CIM_SoftwareIdentity +[ Description ("A logical power supply") ] +class OMC_PowerSupply : CIM_PowerSupply { }; -[ Description ("System firmware") ] -class OMC_SMASHFirmwareIdentity : CIM_SoftwareIdentity +[ Description ("A logical battery") ] +class OMC_Battery : CIM_Battery { }; Modified: schema/branches/cmpi/mof/smash/omc-physical-asset-profile.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-physical-asset-profile.mof 2007-10-05 22:12:19 UTC (rev 498) +++ schema/branches/cmpi/mof/smash/omc-physical-asset-profile.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -6,21 +6,6 @@ #pragma Locale ("en_US") -// ================================================================== -// CIM_PhysicalAssetCapabilities -// ================================================================== -[ Description ("Capability for a physical asset. " - "We include this class here until it gets added to the offical " - "CIM schema. Need to do this in order to make some attempt in " - "implementing the Physical Assets Profile.") ] -class CIM_PhysicalAssetCapabilities : CIM_Capabilities -{ - [ Description("When the FRUInfoSupported property as a value of TRUE, " - "the associated physical elements shall have the following " - "properties populated with non-null, non-blank values: " - "Manufacturer, Model, PartNumber, SerialNumber, SKU.") ] - boolean FRUInfoSupported; -}; // ================================================================== // OMC_PhysicalAssetCapabilities Modified: schema/branches/cmpi/mof/smash/omc-physical-element.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-physical-element.mof 2007-10-05 22:12:19 UTC (rev 498) +++ schema/branches/cmpi/mof/smash/omc-physical-element.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -34,6 +34,7 @@ uint16 OperationalStatus[] = {0}; // unknown string StatusDescriptions[] = {"unknown"}; string Status = "Unknown"; + string uuid = "Unknown"; }; [ Description ("A chip.") ] @@ -67,3 +68,4 @@ String ElementName = "Slot"; }; + Modified: schema/branches/cmpi/mof/smash/omc-powersupply-profile.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-powersupply-profile.mof 2007-10-05 22:12:19 UTC (rev 498) +++ schema/branches/cmpi/mof/smash/omc-powersupply-profile.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -86,6 +86,16 @@ uint16 FailoverSupported; }; +// =========================================================================== +// OMC_SuppliesPower +// =========================================================================== +[Version ( "0.0.1" ), + Description ( + "CIM_SuppliesPower association")] +class OMC_SuppliesPower : CIM_SuppliesPower +{ +}; + // ================================================================== // end of file // ================================================================== Modified: schema/branches/cmpi/mof/smash/omc-rawipmi.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-rawipmi.mof 2007-10-05 22:12:19 UTC (rev 498) +++ schema/branches/cmpi/mof/smash/omc-rawipmi.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -73,6 +73,16 @@ uint32 PSVoltage2; uint32 PSCombinedWattage; uint32 PSPredictiveFailTachLowerThreshold; + + // Availability details (if known) + uint16 Availability = 2; + + //Networking information + boolean LANAccess; + string IPv4Address; + string IPv4DefaultGateway; + string IPv4Netmask; + string MACAddress; }; [ Description("IPMI Sensor Data") ] @@ -95,6 +105,7 @@ string PossibleStates[]; string CurrentState; + uint16 RawSensorState; uint32 EventReadingType; uint32 SensorDirection; uint16 RateUnit; @@ -136,6 +147,11 @@ uint16 SupportedThresholds[]; uint16 EnabledThresholds[]; uint16 SettableThresholds[]; + uint32 ReadableMask; + uint32 SettableMask; + uint16 EnabledState; + datetime TimeOfLastStateChange; + datetime TimeOfPeakReading; [Description ( Modified: schema/branches/cmpi/mof/smash/omc-registered-profile-common.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-registered-profile-common.mof 2007-10-05 22:12:19 UTC (rev 498) +++ schema/branches/cmpi/mof/smash/omc-registered-profile-common.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -4,6 +4,7 @@ //#pragma inLine ("Includes/copyright.inc") // Copyright 2005 Novell, Inc // All rights reserved. +// Copyright (c) 2007 VMware, Inc. All rights reserved. // ================================================================== // // This is the file that will contain registered profile stuff that @@ -316,7 +317,38 @@ }; +// =========================================================================== +// OMC_RegisteredSoftwareInventoryProfile +// =========================================================================== +[Version ( "0.0.1" ), + Description ( + "OMC's instrumentation of SMASH's Software Inventory Profile.")] +class OMC_RegisteredSoftwareInventoryProfile : OMC_RegisteredProfile +{ +}; + + +// =========================================================================== +// OMC_ElementConformsToSoftwareInventoryProfile +// =========================================================================== +[Association, Version ( "0.0.1" ), + Description ( + "OMC's instrumentation of SMASH's Software Inventory Profile, " + "indicating that a ManagedElement conforms to the Software Inventory Profile")] +class OMC_ElementConformsToSoftwareInventoryProfile : OMC_ElementConformsToProfile +{ + [Override ( "ConformantStandard" ), Key, + Description ( + "The OMC_RegisteredProfile to which the ManagedElement " + "conforms.")] + OMC_RegisteredSoftwareInventoryProfile REF ConformantStandard; + [Override ( "ManagedElement" ), Key, + Description ( + "The ManagedElement that conforms to the " + "OMC_RegisteredProfile.")] + CIM_ManagedElement REF ManagedElement; +}; // ================================================================== Modified: schema/branches/cmpi/mof/smash/omc-sensor-profile.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-sensor-profile.mof 2007-10-05 22:12:19 UTC (rev 498) +++ schema/branches/cmpi/mof/smash/omc-sensor-profile.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -4,6 +4,7 @@ //#pragma inLine ("Includes/copyright.inc") // Copyright 2005 Novell, Inc // All rights reserved. +// Copyright (c) 2007 VMware, Inc. All rights reserved. // ================================================================== // // current file version 0.0.2 @@ -30,7 +31,7 @@ [Override ( "Dependent" ), Description ( "The ManagedElement for which information is measured by the " "Sensor.")] - CIM_ManagedElement REF Dependent; + CIM_ManagedSystemElement REF Dependent; }; Modified: schema/branches/cmpi/mof/smash/omc-smash-devices.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-smash-devices.mof 2007-10-05 22:12:19 UTC (rev 498) +++ schema/branches/cmpi/mof/smash/omc-smash-devices.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -4,6 +4,7 @@ //#pragma inLine ("Includes/copyright.inc") // Copyright 2005 Novell, Inc // All rights reserved. +// Copyright (c) 2007 VMware, Inc. All rights reserved. // ================================================================== // // current file version 0.0.2 @@ -119,6 +120,12 @@ "OMC's instrumentation of CIM_NumericSensor")] class OMC_NumericSensor : CIM_NumericSensor { + + [ Description( + "The time at which the sensor reading reached " + "its peak value.") + ] + datetime TimeOfPeakReading; string MonitoredDeviceId; [ Description( @@ -166,7 +173,14 @@ uint16 OperationalStatus[] = {0}; // default: unknown uint16 HealthState = 0; // default: unknown string ElementName = "Memory"; // default + uint16 Access = 3; // Read/Write Supported + // Although it breaks standard compliance we should + // leave volatile unset if we are unable to determine + // the property value for a given instance. + // boolean Volatile = TRUE; + + }; @@ -312,150 +326,23 @@ }] string OtherAssociativityDescription; + uint16 Access = 3; // Read/Write Supported + boolean Volatile = TRUE; + }; - - - ////////////////////////////////////////////////////////////////////////////// -[ Description ("OMC's instrumentation of Ethernet Port Profile.") ] -class OMC_EthernetPort : CIM_EthernetPort +class OMC_IpmiAlertIndication : CIM_AlertIndication { +}; - uint16 LinkTechnology = 2; - [Description ( - "PermanentAddress defines the network address that is " - "hardcoded into a port."), - MaxLen ( 64 ) ] - string PermanentAddress; - - string SystemCreationClassName; - - string SystemName; - - [Key, Description ( - "CreationClassName indicates the name of the class or the " - "subclass used in the creation of an instance. When used " - "with the other key properties of this class, this property " - "allows all instances of this class and its subclasses to be " - "uniquely identified."), - MaxLen ( 256 )] - string CreationClassName; - - [Key, Description ( - "An address or other identifying information to uniquely " - "name the LogicalDevice."), - MaxLen ( 64 )] - - string DeviceID; - -[Description ( - "EnabledState is an integer enumeration that indicates the " - "enabled and disabled states of an element. "), - ValueMap { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", - "10", "11..32767", "32768..65535" }, - Values { "Unknown", "Other", "Enabled", "Disabled", - "Shutting Down", "Not Applicable", "Enabled but Offline", - "In Test", "Deferred", "Quiesce", "Starting", - "DMTF Reserved", "Vendor Reserved" }] - uint16 EnabledState = 5; - - [Description ("RequestedState is an integer enumeration that indicates the " - "last requested or desired state for the element. The actual " - "state of the element is represented by EnabledState."), - ValueMap { "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", - "12", "..", "32768..65535" }, - Values { "Enabled", "Disabled", "Shut Down", "No Change", - "Offline", "Test", "Deferred", "Quiesce", "Reboot", "Reset", - "Not Applicable", "DMTF Reserved", "Vendor Reserved" }, - ModelCorrespondence { "CIM_EnabledLogicalElement.EnabledState" }] - uint16 RequestedState = 12; - - [Description ( - "A user-friendly name for the object. This property allows " - "each instance to define a user-friendly name in addition to " - "its key properties, identity data, and description " - "information. \n")] - - string ElementName; - - [Description ( - "Requests that the state of the element be changed to the " - "value specified in the RequestedState parameter."), - ValueMap { "0", "1", "2", "3", "4", "5", "6", "..", "4096", - "4097", "4098", "4099", "4100..32767", "32768..65535" }, - Values { "Completed with No Error", "Not Supported", - "Unknown or Unspecified Error", - "Cannot complete within Timeout Period", "Failed", - "Invalid Parameter", "In Use", "DMTF Reserved", - "Method Parameters Checked - Job Started", - "Invalid State Transition", - "Use of Timeout Parameter Not Supported", "Busy", - "Method Reserved", "Vendor Specific" } - ] - uint32 RequestStateChange( - [IN, Description ( - "The state requested for the element. "), - ValueMap { "2", "3", "4", "6", "7", "8", "9", "10", "11", - "..", "32768..65535" }, - Values { "Enabled", "Disabled", "Shut Down", "Offline", - "Test", "Defer", "Quiesce", "Reboot", "Reset", - "DMTF Reserved", "Vendor Reserved" }] - - uint16 RequestedState, - [IN ( false ), OUT, Description ( - "Reference to the job (can be null if the task is " - "completed).")] - CIM_ConcreteJob REF Job, - [IN, Description ( - "A timeout period that specifies the maximum amount of " - "time that the client expects the transition to the new " - "state to take. The interval format must be used to " - "specify the TimeoutPeriod. A value of 0 or a null " - "parameter indicates that the client has no time " - "requirements for the transition. \n" - "If this property does not contain 0 or null and the " - "implementation does not support this parameter, a return " - "code of 'Use Of Timeout Parameter Not Supported' must be " - "returned.")] - datetime TimeoutPeriod); - - -[Override ( "PortType" ), Description ( - "The specific mode that is currently enabled for the Port. " - "When set to 1 (\"Other\"), the related property " - "OtherPortType contains a string description of the type of " - "port."), - ValueMap { "0", "1", "50", "51", "52", "53", "54", "55", "56", - "100", "101", "102", "103", "104", "105", "106", "107", - "108", "109", "110", "111", "16000..65535" }, - Values { "Unknown", "Other", - //50 Copper - "10BaseT", "10-100BaseT", "100BaseT", "1000BaseT", - "2500BaseT", "10GBaseT", "10GBase-CX4", - //100 Fiber - "100Base-FX", "100Base-SX", "1000Base-SX", "1000Base-LX", - "1000Base-CX", "10GBase-SR", "10GBase-SW", "10GBase-LX4", - "10GBase-LR", "10GBase-LW", "10GBase-ER", "10GBase-EW", - "Vendor Reserved" }] - uint16 PortType = 52; - - [Override ( "NetworkAddresses" ), Description ( - "Ethernet/802.3 MAC addresses formatted as twelve " - "hexadecimal digits (for example, \"010203040506\"), with " - "each pair representing one of the six octets of the MAC " - "address in \"canonical\" bit order. (Therefore, the Group " - "address bit is found in the low order bit of the first " - "character of the string.)")] - string NetworkAddresses[]; - - uint16 Capabilities[] = {0}; // Unknown - uint16 EnabledCapabilities[] = {0}; // Unknown - +////////////////////////////////////////////////////////////////////////////// +[ Description ("OMC's instrumentation the System Device association for SMBIOS devices.") ] +class OMC_SMBIOSSystemDevice : CIM_SystemDevice +{ }; - // ================================================================== // end of file // ================================================================== Added: schema/branches/cmpi/mof/smash/omc-smash-internal-schema.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-smash-internal-schema.mof (rev 0) +++ schema/branches/cmpi/mof/smash/omc-smash-internal-schema.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -0,0 +1,4 @@ +#pragma Locale ("en_US") +#pragma include ("omc-smash-providers.mof") +#pragma include ("omc-smash-providers-interop-ns.mof") + Added: schema/branches/cmpi/mof/smash/omc-smash-interop-schema.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-smash-interop-schema.mof (rev 0) +++ schema/branches/cmpi/mof/smash/omc-smash-interop-schema.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -0,0 +1,3 @@ +#pragma Locale ("en_US") +#pragma include ("omc-smash-providers-interop-ns.mof") + Added: schema/branches/cmpi/mof/smash/omc-smash-ipmi-schema.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-smash-ipmi-schema.mof (rev 0) +++ schema/branches/cmpi/mof/smash/omc-smash-ipmi-schema.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -0,0 +1,5 @@ +#pragma Locale ("en_US") +#pragma include ("omc-smash-providers.mof") +#pragma include ("omc-smash-providers-interop-ns.mof") +#pragma include ("omc-rawipmi.mof") + Modified: schema/branches/cmpi/mof/smash/omc-smash-providers-composite-ns.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-smash-providers-composite-ns.mof 2007-10-05 22:12:19 UTC (rev 498) +++ schema/branches/cmpi/mof/smash/omc-smash-providers-composite-ns.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -6,5 +6,6 @@ #pragma include ("omc-physical-element.mof") #pragma include ("omc-smash-devices.mof") #pragma include ("omc-logical-devices.mof") +#pragma include ("omc-software.mof") #pragma include ("omc-computer-system-mirror.mof") Modified: schema/branches/cmpi/mof/smash/omc-smash-providers.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-smash-providers.mof 2007-10-05 22:12:19 UTC (rev 498) +++ schema/branches/cmpi/mof/smash/omc-smash-providers.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -32,17 +32,18 @@ #pragma include ("omc-processor-profile.mof") #pragma include ("omc-record-log-profile.mof") #pragma include ("omc-logical-devices.mof") +#pragma include ("omc-software.mof") #pragma include ("omc-bios-element.mof") #pragma include ("omc-physical-asset-profile.mof") #pragma include ("omc-powersupply-profile.mof") -#pragma include ("omc-ssh-service-profile.mof") -#pragma include ("omc-boot-control-profile.mof") +//#pragma include ("omc-ssh-service-profile.mof") +//#pragma include ("omc-boot-control-profile.mof") #pragma include ("omc-system-memory-profile.mof") #pragma include ("omc-firmware-inventory-profile.mof") #pragma include ("omc-system-collections-profile.mof") -#pragma include ("omc-ethernet-port.mof") -#pragma include ("omc-ip-interface.mof") -#pragma include ("omc-dhcp-client-profile.mof") -#pragma include ("omc-dnsclient-profile.mof") +//#pragma include ("omc-ethernet-port.mof") +//#pragma include ("omc-ip-interface.mof") +//#pragma include ("omc-dhcp-client-profile.mof") +//#pragma include ("omc-dnsclient-profile.mof") Added: schema/branches/cmpi/mof/smash/omc-smash-schema.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-smash-schema.mof (rev 0) +++ schema/branches/cmpi/mof/smash/omc-smash-schema.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -0,0 +1,3 @@ +#pragma Locale ("en_US") +#pragma include ("omc-smash-providers.mof") +#pragma include ("omc-smash-providers-interop-ns.mof") Added: schema/branches/cmpi/mof/smash/omc-smash-smbios-schema.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-smash-smbios-schema.mof (rev 0) +++ schema/branches/cmpi/mof/smash/omc-smash-smbios-schema.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -0,0 +1,4 @@ +#pragma Locale ("en_US") +#pragma include ("omc-smash-providers.mof") +#pragma include ("omc-smash-providers-interop-ns.mof") + Added: schema/branches/cmpi/mof/smash/omc-software.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-software.mof (rev 0) +++ schema/branches/cmpi/mof/smash/omc-software.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -0,0 +1,31 @@ +// ================================================================== +// OMC_SoftwareIdentity +// ================================================================== + [Version ( "0.0.1" ), Description ( + "OMC's instrumentation of CIM_SoftwareIdentity")] +class OMC_SoftwareIdentity : CIM_SoftwareIdentity { +}; + +[ Description ("System software") ] +class OMC_SMASHSoftwareIdentity : OMC_SoftwareIdentity +{ +}; + +[ Description ("System firmware") ] +class OMC_SMASHFirmwareIdentity : OMC_SoftwareIdentity +{ +}; + +[Association] +class OMC_InstalledSoftwareIdentity : CIM_InstalledSoftwareIdentity +{ + [Override ( "System" ), Key, + Description ( "The system on which the software is installed.")] + OMC_UnitaryComputerSystem REF System; + + [Override ("InstalledSoftware" ), Key, + Description ( + "The SoftwareIdentity that is installed.")] + OMC_SoftwareIdentity REF InstalledSoftware; +}; + Modified: schema/branches/cmpi/mof/smash/omc-user-group-profile.mof =================================================================== --- schema/branches/cmpi/mof/smash/omc-user-group-profile.mof 2007-10-05 22:12:19 UTC (rev 498) +++ schema/branches/cmpi/mof/smash/omc-user-group-profile.mof 2007-10-05 23:20:20 UTC (rev 499) @@ -4,6 +4,7 @@ //#pragma inLine ("Includes/copyright.inc") // Copyright 2005 Novell, Inc // All rights reserved. +// Copyright (c) 2007 VMware, Inc. All rights reserved. // ================================================================== // // current file version 0.0.2 @@ -24,7 +25,7 @@ // OMC_UserAccount // ================================================================== [Version ( "0.0.1" ), Description ( - "OMC's extension of CIM_Account, used by SMASH's User Group Profile" + "OMC's extension of CIM_Account, used by SMASH's User Group Profile")] class OMC_UserAccount : CIM_Account { }; @@ -32,7 +33,7 @@ // OMC_UserGroup // ================================================================== [Version ( "0.0.1" ), Description ( - "OMC's extension of CIM_Group, used by SMASH's User Group Profile" + "OMC's extension of CIM_Group, used by SMASH's User Group Profile")] class OMC_UserGroup : CIM_Group { }; @@ -41,7 +42,7 @@ // ================================================================== [Version ( "0.0.1" ), Description ( "OMC's extension of CIM_AuthorizedPrivilege, used by SMASH's " - "User Group Profile" + "User Group Profile")] class OMC_AuthorizedUserGroupPrivilege : CIM_AuthorizedPrivilege { }; @@ -52,7 +53,7 @@ // ================================================================== [Association, Version ( "0.0.1" ), Description ( "OMC's extension of CIM_MemberOfCollection for members of a group, " - "used by SMASH's User Group Profile" + "used by SMASH's User Group Profile")] class OMC_MemberOfUserGroup : CIM_MemberOfCollection { [Override ( "Collection" ), Key, Description ( "The OMC_UserGroup of which the OMC_UserAccount is a member.")] @@ -70,7 +71,7 @@ // ================================================================== [Association, Version ( "0.0.1" ), Description ( "OMC's extension of CIM_AccountOnSystem for userAccounts on a system " - "used by SMASH's User Group Profile" + "used by SMASH's User Group Profile")] class OMC_UserAccountOnSystem : CIM_AccountOnSystem { [Override ( "Dependent" ), Key, Description ( "The OMC_UserAccount that is an account on the system.")] @@ -85,7 +86,7 @@ // ================================================================== [Association, Version ( "0.0.1" ), Description ( "OMC's extension of CIM_AccountOnSystem for userAccounts on a system " - "used by SMASH's User Group Profile" + "used by SMASH's User Group Profile")] class OMC_HostedUserGroupCollection : CIM_HostedCollection { [Override ( "PartComponent" ), Key, Description ( "The OMC_UserGroup that is hosted on the system.")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhi...@us...> - 2007-10-05 22:12:17
|
Revision: 498 http://omc.svn.sourceforge.net/omc/?rev=498&view=rev Author: dhiltgen Date: 2007-10-05 15:12:19 -0700 (Fri, 05 Oct 2007) Log Message: ----------- Create CMPI branch for base Added Paths: ----------- base/branches/cmpi/ Copied: base/branches/cmpi (from rev 497, base/trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dhi...@us...> - 2007-10-05 22:11:12
|
Revision: 497 http://omc.svn.sourceforge.net/omc/?rev=497&view=rev Author: dhiltgen Date: 2007-10-05 15:11:14 -0700 (Fri, 05 Oct 2007) Log Message: ----------- Create CMPI branch for the OMC schema Added Paths: ----------- schema/branches/cmpi/ Copied: schema/branches/cmpi (from rev 496, schema/trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jc...@us...> - 2007-09-21 16:48:59
|
Revision: 496 http://omc.svn.sourceforge.net/omc/?rev=496&view=rev Author: jcarey Date: 2007-09-21 09:49:02 -0700 (Fri, 21 Sep 2007) Log Message: ----------- >From brieske: added memcpy if share count > 1 Modified Paths: -------------- smash/branches/1.0/src/lib/omc-ipmi/IpmiIfcSdr.cpp Modified: smash/branches/1.0/src/lib/omc-ipmi/IpmiIfcSdr.cpp =================================================================== --- smash/branches/1.0/src/lib/omc-ipmi/IpmiIfcSdr.cpp 2007-09-21 16:43:07 UTC (rev 495) +++ smash/branches/1.0/src/lib/omc-ipmi/IpmiIfcSdr.cpp 2007-09-21 16:49:02 UTC (rev 496) @@ -502,6 +502,7 @@ OW_LOG_ERROR(g_logger, "IpmiIfcSdrListAdd: failed memory alloc."); return(-1); } + memcpy(record_data,sdr->record.unknown,sdr->length); ipmiifc_sdr_list *copySdr; copySdr = new ipmiifc_sdr_list; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2007-09-21 16:43:22
|
Revision: 495 http://omc.svn.sourceforge.net/omc/?rev=495&view=rev Author: brieske Date: 2007-09-21 09:43:07 -0700 (Fri, 21 Sep 2007) Log Message: ----------- Added memcpy for sdr on when share count >1 Modified Paths: -------------- smash/trunk/src/lib/omc-ipmi/IpmiIfcSdr.cpp Modified: smash/trunk/src/lib/omc-ipmi/IpmiIfcSdr.cpp =================================================================== --- smash/trunk/src/lib/omc-ipmi/IpmiIfcSdr.cpp 2007-09-21 15:57:23 UTC (rev 494) +++ smash/trunk/src/lib/omc-ipmi/IpmiIfcSdr.cpp 2007-09-21 16:43:07 UTC (rev 495) @@ -502,6 +502,7 @@ OW_LOG_ERROR(g_logger, "IpmiIfcSdrListAdd: failed memory alloc."); return(-1); } + memcpy(record_data,sdr->record.unknown,sdr->length); ipmiifc_sdr_list *copySdr; copySdr = new ipmiifc_sdr_list; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jc...@us...> - 2007-09-21 15:57:20
|
Revision: 494 http://omc.svn.sourceforge.net/omc/?rev=494&view=rev Author: jcarey Date: 2007-09-21 08:57:23 -0700 (Fri, 21 Sep 2007) Log Message: ----------- Changed to not build the ipmi providers at all if the --disable-ipmi is specified Modified Paths: -------------- smash/branches/1.0/src/providers/device/ipmi/Makefile.am Modified: smash/branches/1.0/src/providers/device/ipmi/Makefile.am =================================================================== --- smash/branches/1.0/src/providers/device/ipmi/Makefile.am 2007-09-21 15:56:49 UTC (rev 493) +++ smash/branches/1.0/src/providers/device/ipmi/Makefile.am 2007-09-21 15:57:23 UTC (rev 494) @@ -1,3 +1,5 @@ +if USE_IPMI_NS + include $(top_srcdir)/Makefile.incl.am provider_LTLIBRARIES = \ @@ -136,3 +138,4 @@ -lomcbase \ -version-info 1 +endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jc...@us...> - 2007-09-21 15:56:45
|
Revision: 493 http://omc.svn.sourceforge.net/omc/?rev=493&view=rev Author: jcarey Date: 2007-09-21 08:56:49 -0700 (Fri, 21 Sep 2007) Log Message: ----------- Changed to not build the ipmi providers at all if the --disable-ipmi is specified Modified Paths: -------------- smash/trunk/src/providers/device/ipmi/Makefile.am Modified: smash/trunk/src/providers/device/ipmi/Makefile.am =================================================================== --- smash/trunk/src/providers/device/ipmi/Makefile.am 2007-09-11 16:33:58 UTC (rev 492) +++ smash/trunk/src/providers/device/ipmi/Makefile.am 2007-09-21 15:56:49 UTC (rev 493) @@ -1,3 +1,5 @@ +if USE_IPMI_NS + include $(top_srcdir)/Makefile.incl.am provider_LTLIBRARIES = \ @@ -136,3 +138,4 @@ -lomcbase \ -version-info 1 +endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2007-09-11 16:34:04
|
Revision: 492 http://omc.svn.sourceforge.net/omc/?rev=492&view=rev Author: bartw Date: 2007-09-11 09:33:58 -0700 (Tue, 11 Sep 2007) Log Message: ----------- some fixes OMC_UnixProcess.py Modified Paths: -------------- pybase/trunk/OMC_LogicalFile.py pybase/trunk/OMC_UnitaryComputerSystem.py pybase/trunk/OMC_UnixProcess.py Modified: pybase/trunk/OMC_LogicalFile.py =================================================================== --- pybase/trunk/OMC_LogicalFile.py 2007-09-10 17:07:42 UTC (rev 491) +++ pybase/trunk/OMC_LogicalFile.py 2007-09-11 16:33:58 UTC (rev 492) @@ -836,8 +836,8 @@ get_file_keys(os.path.dirname(objname), kbs) model['groupcomponent'] = pywbem.CIMInstanceName( classname=kbs['CreationClassName'], - namespace=object_name.namespace, keybindings=kbs) + #namespace=object_name.namespace, yield model if (not role or role.lower() == 'groupcomponent') \ and object_name.classname.lower() == 'omc_linuxdirectory': @@ -851,8 +851,8 @@ get_file_keys(fname, kbs) model['partcomponent'] = pywbem.CIMInstanceName( classname=kbs['CreationClassName'], - namespace=object_name.namespace, keybindings=kbs) + #namespace=object_name.namespace, yield model except OSError, arg: if arg.errno == 13: Modified: pybase/trunk/OMC_UnitaryComputerSystem.py =================================================================== --- pybase/trunk/OMC_UnitaryComputerSystem.py 2007-09-10 17:07:42 UTC (rev 491) +++ pybase/trunk/OMC_UnitaryComputerSystem.py 2007-09-11 16:33:58 UTC (rev 492) @@ -98,7 +98,7 @@ #model['ElementName'] = # TODO (type = unicode) #model['Roles'] = # TODO (type = [unicode,]) #model['ResetCapability'] = # TODO (type = pywbem.Uint16 self.Values.ResetCapability) - #model['NameFormat'] = # TODO (type = unicode self.Values.NameFormat) + model['NameFormat'] = self.Values.NameFormat.IP #model['Caption'] = # TODO (type = unicode) #model['PowerManagementCapabilities'] = # TODO (type = [pywbem.Uint16,] self.Values.PowerManagementCapabilities) return model Modified: pybase/trunk/OMC_UnixProcess.py =================================================================== --- pybase/trunk/OMC_UnixProcess.py 2007-09-10 17:07:42 UTC (rev 491) +++ pybase/trunk/OMC_UnixProcess.py 2007-09-11 16:33:58 UTC (rev 492) @@ -37,11 +37,8 @@ import pywbem, os, sys, pwd, signal, time from socket import getfqdn -provdir = os.path.dirname(__file__) -if provdir not in sys.path: - sys.path.append(provdir) - import OMC_LogicalFile +from OMC_OperatingSystem import get_os_path PROC_STATE_DOESNT_EXIST = -1 @@ -738,8 +735,8 @@ % self.__class__.__name__) for lp in LinuxProcess.procs(): model['PartComponent'] = lp.get_instance_name( - cim_class.namespace) - model['GroupComponent'] = get_os_path(cim_class.namespace) + model.path.namespace) + model['GroupComponent'] = get_os_path(model.path.namespace) yield model def set_instance(self, env, instance, previous_instance, cim_class): @@ -782,7 +779,6 @@ object_name.namespace, sub='omc_operatingsystem', super=result_class_name): return - from OMC_OperatingSystem import get_os_path lp = LinuxProcess.get_proc(object_name['handle']) if not lp: return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bc...@us...> - 2007-09-10 17:07:40
|
Revision: 491 http://omc.svn.sourceforge.net/omc/?rev=491&view=rev Author: bcwise Date: 2007-09-10 10:07:42 -0700 (Mon, 10 Sep 2007) Log Message: ----------- CHANGED some routines to have return values consistent with the declaration. Modified Paths: -------------- base/branches/1.0/src/providers/operating-system/linux_os.cpp Modified: base/branches/1.0/src/providers/operating-system/linux_os.cpp =================================================================== --- base/branches/1.0/src/providers/operating-system/linux_os.cpp 2007-09-10 17:00:48 UTC (rev 490) +++ base/branches/1.0/src/providers/operating-system/linux_os.cpp 2007-09-10 17:07:42 UTC (rev 491) @@ -826,12 +826,7 @@ String LinuxOperatingSystem::getOtherTypeDescription() { -#if 1 - char *s = ""; - return s; -#else return String(); -#endif } // LinuxOperatingSystem::getOtherTypeDescription() @@ -938,11 +933,7 @@ String LinuxOperatingSystem::getStatus() { -#if 1 - return("NULL"); -#else return String(); -#endif } // LinuxOperatingSystem::getStatus() @@ -996,8 +987,6 @@ String LinuxOperatingSystem::getVersion() { - -#if 1 struct utsname puname; String rval = ""; @@ -1008,10 +997,6 @@ rval = puname.release; return rval; -#else - return String(); -#endif - } // LinuxOperatingSystem::getVersion() //============================================================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <np...@us...> - 2007-09-10 17:00:45
|
Revision: 490 http://omc.svn.sourceforge.net/omc/?rev=490&view=rev Author: npaxton Date: 2007-09-10 10:00:48 -0700 (Mon, 10 Sep 2007) Log Message: ----------- added copyright string Modified Paths: -------------- pyprofiles/simpleIdentity/OMC_Account.py pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py pyprofiles/simpleIdentity/OMC_AccountOnSystem.py pyprofiles/simpleIdentity/OMC_AssignedIdentity.py pyprofiles/simpleIdentity/OMC_Identity.py pyprofiles/simpleIdentity/OMC_UserAccntMgmtHostedServiceProvider.py pyprofiles/simpleIdentity/OMC_UserAccountManagementServiceProvider.py pyprofiles/simpleIdentity/setup.py Modified: pyprofiles/simpleIdentity/OMC_Account.py =================================================================== --- pyprofiles/simpleIdentity/OMC_Account.py 2007-09-10 16:41:07 UTC (rev 489) +++ pyprofiles/simpleIdentity/OMC_Account.py 2007-09-10 17:00:48 UTC (rev 490) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2007 Novell, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# - Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# - Neither the name of Novell, Inc. nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +#*****************************************************************************/ """Python Provider for OMC_Account Instruments the CIM class OMC_Account Modified: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py =================================================================== --- pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py 2007-09-10 16:41:07 UTC (rev 489) +++ pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py 2007-09-10 17:00:48 UTC (rev 490) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2007 Novell, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# - Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# - Neither the name of Novell, Inc. nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +#*****************************************************************************/ """Python Provider for OMC_AccountElementCapabilities Instruments the CIM class OMC_AccountElementCapabilities Modified: pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py =================================================================== --- pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py 2007-09-10 16:41:07 UTC (rev 489) +++ pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py 2007-09-10 17:00:48 UTC (rev 490) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2007 Novell, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# - Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# - Neither the name of Novell, Inc. nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +#*****************************************************************************/ """Python Provider for OMC_AccountManagementCapabilities Instruments the CIM class OMC_AccountManagementCapabilities Modified: pyprofiles/simpleIdentity/OMC_AccountOnSystem.py =================================================================== --- pyprofiles/simpleIdentity/OMC_AccountOnSystem.py 2007-09-10 16:41:07 UTC (rev 489) +++ pyprofiles/simpleIdentity/OMC_AccountOnSystem.py 2007-09-10 17:00:48 UTC (rev 490) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2007 Novell, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# - Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# - Neither the name of Novell, Inc. nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +#*****************************************************************************/ """Python Provider for OMC_AccountOnSystem Instruments the CIM class OMC_AccountOnSystem Modified: pyprofiles/simpleIdentity/OMC_AssignedIdentity.py =================================================================== --- pyprofiles/simpleIdentity/OMC_AssignedIdentity.py 2007-09-10 16:41:07 UTC (rev 489) +++ pyprofiles/simpleIdentity/OMC_AssignedIdentity.py 2007-09-10 17:00:48 UTC (rev 490) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2007 Novell, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# - Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# - Neither the name of Novell, Inc. nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +#*****************************************************************************/ """Python Provider for OMC_AssignedIdentity Instruments the CIM class OMC_AssignedIdentity Modified: pyprofiles/simpleIdentity/OMC_Identity.py =================================================================== --- pyprofiles/simpleIdentity/OMC_Identity.py 2007-09-10 16:41:07 UTC (rev 489) +++ pyprofiles/simpleIdentity/OMC_Identity.py 2007-09-10 17:00:48 UTC (rev 490) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2007 Novell, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# - Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# - Neither the name of Novell, Inc. nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +#*****************************************************************************/ """Python Provider for OMC_Identity Instruments the CIM class OMC_Identity Modified: pyprofiles/simpleIdentity/OMC_UserAccntMgmtHostedServiceProvider.py =================================================================== --- pyprofiles/simpleIdentity/OMC_UserAccntMgmtHostedServiceProvider.py 2007-09-10 16:41:07 UTC (rev 489) +++ pyprofiles/simpleIdentity/OMC_UserAccntMgmtHostedServiceProvider.py 2007-09-10 17:00:48 UTC (rev 490) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2007 Novell, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# - Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# - Neither the name of Novell, Inc. nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +#*****************************************************************************/ """Python Provider for OMC_UserAccntMgmtHostedService Instruments the CIM class OMC_UserAccntMgmtHostedService Modified: pyprofiles/simpleIdentity/OMC_UserAccountManagementServiceProvider.py =================================================================== --- pyprofiles/simpleIdentity/OMC_UserAccountManagementServiceProvider.py 2007-09-10 16:41:07 UTC (rev 489) +++ pyprofiles/simpleIdentity/OMC_UserAccountManagementServiceProvider.py 2007-09-10 17:00:48 UTC (rev 490) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2007 Novell, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# - Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# - Neither the name of Novell, Inc. nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +#*****************************************************************************/ """Python Provider for OMC_UserAccountManagementService Instruments the CIM class OMC_UserAccountManagementService Modified: pyprofiles/simpleIdentity/setup.py =================================================================== --- pyprofiles/simpleIdentity/setup.py 2007-09-10 16:41:07 UTC (rev 489) +++ pyprofiles/simpleIdentity/setup.py 2007-09-10 17:00:48 UTC (rev 490) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2007 Novell, Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# - Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# - Neither the name of Novell, Inc. nor the names of its +# contributors may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +#*****************************************************************************/ #!/usr/bin/env python # Note, you'll typically want to override where these get installed. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <np...@us...> - 2007-09-10 16:41:03
|
Revision: 489 http://omc.svn.sourceforge.net/omc/?rev=489&view=rev Author: npaxton Date: 2007-09-10 09:41:07 -0700 (Mon, 10 Sep 2007) Log Message: ----------- move pysoftware under pyprofiles Added Paths: ----------- pyprofiles/pysoftware/ Removed Paths: ------------- pysoftware/ Copied: pyprofiles/pysoftware (from rev 485, pysoftware) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <np...@us...> - 2007-09-10 16:38:45
|
Revision: 488 http://omc.svn.sourceforge.net/omc/?rev=488&view=rev Author: npaxton Date: 2007-09-10 09:38:45 -0700 (Mon, 10 Sep 2007) Log Message: ----------- simpleIdentity initial checkin, under new top-level pyprofiles Added Paths: ----------- pyprofiles/ pyprofiles/simpleIdentity/ pyprofiles/simpleIdentity/MANIFEST pyprofiles/simpleIdentity/OMC_Account.mof pyprofiles/simpleIdentity/OMC_Account.py pyprofiles/simpleIdentity/OMC_Account.reg pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.mof pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.reg pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.mof pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.reg pyprofiles/simpleIdentity/OMC_AccountOnSystem.mof pyprofiles/simpleIdentity/OMC_AccountOnSystem.py pyprofiles/simpleIdentity/OMC_AccountOnSystem.reg pyprofiles/simpleIdentity/OMC_AssignedIdentity.mof pyprofiles/simpleIdentity/OMC_AssignedIdentity.py pyprofiles/simpleIdentity/OMC_AssignedIdentity.reg pyprofiles/simpleIdentity/OMC_Identity.mof pyprofiles/simpleIdentity/OMC_Identity.py pyprofiles/simpleIdentity/OMC_Identity.reg pyprofiles/simpleIdentity/OMC_UserAccntMgmtHostedService.mof pyprofiles/simpleIdentity/OMC_UserAccntMgmtHostedService.reg pyprofiles/simpleIdentity/OMC_UserAccntMgmtHostedServiceProvider.py pyprofiles/simpleIdentity/OMC_UserAccountManagementService.mof pyprofiles/simpleIdentity/OMC_UserAccountManagementService.reg pyprofiles/simpleIdentity/OMC_UserAccountManagementServiceProvider.py pyprofiles/simpleIdentity/omc-simple-identity-management-provider.spec pyprofiles/simpleIdentity/setup.py Added: pyprofiles/simpleIdentity/MANIFEST =================================================================== --- pyprofiles/simpleIdentity/MANIFEST (rev 0) +++ pyprofiles/simpleIdentity/MANIFEST 2007-09-10 16:38:45 UTC (rev 488) @@ -0,0 +1,25 @@ +OMC_Account.mof +OMC_Account.py +OMC_Account.reg +OMC_AccountElementCapabilities.mof +OMC_AccountElementCapabilities.py +OMC_AccountElementCapabilities.reg +OMC_AccountManagementCapabilities.mof +OMC_AccountManagementCapabilities.py +OMC_AccountManagementCapabilities.reg +OMC_AccountOnSystem.mof +OMC_AccountOnSystem.py +OMC_AccountOnSystem.reg +OMC_AssignedIdentity.mof +OMC_AssignedIdentity.py +OMC_AssignedIdentity.reg +OMC_Identity.mof +OMC_Identity.py +OMC_Identity.reg +OMC_UserAccntMgmtHostedService.mof +OMC_UserAccntMgmtHostedService.reg +OMC_UserAccntMgmtHostedServiceProvider.py +OMC_UserAccountManagementService.mof +OMC_UserAccountManagementService.reg +OMC_UserAccountManagementServiceProvider.py +setup.py Property changes on: pyprofiles/simpleIdentity/MANIFEST ___________________________________________________________________ Name: svn:executable + * Added: pyprofiles/simpleIdentity/OMC_Account.mof =================================================================== --- pyprofiles/simpleIdentity/OMC_Account.mof (rev 0) +++ pyprofiles/simpleIdentity/OMC_Account.mof 2007-09-10 16:38:45 UTC (rev 488) @@ -0,0 +1,4 @@ +[Description("Model a Account class for getting user information")] +class OMC_Account : CIM_Account +{ +}; Property changes on: pyprofiles/simpleIdentity/OMC_Account.mof ___________________________________________________________________ Name: svn:executable + * Added: pyprofiles/simpleIdentity/OMC_Account.py =================================================================== --- pyprofiles/simpleIdentity/OMC_Account.py (rev 0) +++ pyprofiles/simpleIdentity/OMC_Account.py 2007-09-10 16:38:45 UTC (rev 488) @@ -0,0 +1,414 @@ +"""Python Provider for OMC_Account + +Instruments the CIM class OMC_Account + +""" + +import pywbem +import pwd +import os +from socket import getfqdn + +class OMC_AccountProvider(pywbem.CIMProvider): + """Instrument the CIM class OMC_Account + + Model a Account class for getting user information + + """ + + 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__) + for userinfo in pwd.getpwall(): + if model['Name'] == userinfo[0]: + model['UserPassword'] = userinfo[1] + model['UserID'] = str(userinfo[2]) + model['ElementName'] = userinfo[4]+ ':' + userinfo[0] + model['OrganizationName'] = 'Novell' + break + + #model['Caption'] = # TODO (type = unicode) + #model['ComplexPasswordRulesEnforced'] = # TODO (type = [pywbem.Uint16,] self.Values.ComplexPasswordRulesEnforced) + #model['Description'] = # TODO (type = unicode) + #model['Descriptions'] = # 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) + #model['HealthState'] = # TODO (type = pywbem.Uint16 self.Values.HealthState) + #model['Host'] = # TODO (type = [unicode,]) + #model['InactivityTimeout'] = # TODO (type = pywbem.CIMDateTime) + #model['InstallDate'] = # TODO (type = pywbem.CIMDateTime) + #model['LastLogin'] = # TODO (type = pywbem.CIMDateTime) + #model['LocalityName'] = # TODO (type = [unicode,]) + #model['MaximumSuccessiveLoginFailures'] = # TODO (type = pywbem.Uint16) + #model['ObjectClass'] = # TODO (type = [unicode,]) + #model['OperationalStatus'] = # TODO (type = [pywbem.Uint16,] self.Values.OperationalStatus) + #model['OrganizationName'] = # TODO (type = [unicode,]) (Required) + #model['OtherEnabledState'] = # TODO (type = unicode) + #model['OU'] = # TODO (type = [unicode,]) + #model['PasswordExpiration'] = # TODO (type = pywbem.CIMDateTime) + #model['PasswordHistoryDepth'] = # TODO (type = pywbem.Uint16) + #model['RequestedState'] = # TODO (type = pywbem.Uint16 self.Values.RequestedState) (default=12L) + #model['SeeAlso'] = # TODO (type = [unicode,]) + #model['Status'] = # TODO (type = unicode self.Values.Status) + #model['StatusDescriptions'] = # TODO (type = [unicode,]) + #model['TimeOfLastStateChange'] = # TODO (type = pywbem.CIMDateTime) + #model['UserCertificate'] = # TODO (type = [unicode,]) + #model['UserID'] = # TODO (type = unicode) + #model['UserPassword'] = # TODO (type = [unicode,]) + 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['SystemName'] = # TODO (type = unicode) + #model['SystemCreationClassName'] = # TODO (type = unicode) + model['CreationClassName'] = 'OMC_Account' + model['SystemCreationClassName'] = 'OMC_UnitaryComputerSystem' + model['SystemName'] = getfqdn() + for userinfo in pwd.getpwall(): + model['Name'] = userinfo[0] + #model['Name'] = # TODO (type = unicode) + 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 cim_method_requeststatechange(self, env, object_name, method, + param_requestedstate, + param_timeoutperiod): + """Implements OMC_Account.RequestStateChange() + + Requests that the state of the element be changed to the value + specified in the RequestedState parameter. When the requested + state change takes place, the EnabledState and RequestedState of + the element will be the same. Invoking the RequestStateChange + method multiple times could result in earlier requests being + overwritten or lost. If 0 is returned, then the task completed + successfully and the use of ConcreteJob was not required. If 4096 + (0x1000) is returned, then the task will take some time to + complete, ConcreteJob will be created, and its reference returned + in the output parameter Job. Any other return code indicates an + error condition. + + Keyword arguments: + env -- Provider Environment (pycimmb.ProviderEnvironment) + object_name -- A pywbem.CIMInstanceName or pywbem.CIMCLassName + specifying the object on which the method RequestStateChange() + should be invoked. + method -- A pywbem.CIMMethod representing the method meta-data + param_requestedstate -- The input parameter RequestedState (type pywbem.Uint16 self.Values.RequestStateChange.RequestedState) + The state requested for the element. This information will be + placed into the RequestedState property of the instance if the + return code of the RequestStateChange method is 0 ('Completed + with No Error'), 3 ('Timeout'), or 4096 (0x1000) ('Job + Started'). Refer to the description of the EnabledState and + RequestedState properties for the detailed explanations of the + RequestedState values. + + param_timeoutperiod -- The input parameter TimeoutPeriod (type pywbem.CIMDateTime) + A timeout period that specifies the maximum amount of time that + the client expects the transition to the new state to take. + The interval format must be used to specify the TimeoutPeriod. + A value of 0 or a null parameter indicates that the client has + no time requirements for the transition. If this property + does not contain 0 or null and the implementation does not + support this parameter, a return code of 'Use Of Timeout + Parameter Not Supported' must be returned. + + + Returns a two-tuple containing the return value (type pywbem.Uint32 self.Values.RequestStateChange) + and a dictionary with the out-parameters + + Output parameters: + Job -- (type REF (pywbem.CIMInstanceName(classname='CIM_ConcreteJob', ...)) + Reference to the job (can be null if the task is completed). + + + Possible Errors: + CIM_ERR_ACCESS_DENIED + CIM_ERR_INVALID_PARAMETER (including missing, duplicate, + unrecognized or otherwise incorrect parameters) + CIM_ERR_NOT_FOUND (the target CIM Class or instance does not + exist in the specified namespace) + CIM_ERR_METHOD_NOT_AVAILABLE (the CIM Server is unable to honor + the invocation request) + CIM_ERR_FAILED (some other unspecified error occurred) + + """ + + logger = env.get_logger() + logger.log_debug('Entering %s.cim_method_requeststatechange()' \ + % self.__class__.__name__) + + # TODO do something + raise pywbem.CIMError(pywbem.CIM_ERR_METHOD_NOT_AVAILABLE) # Remove to implemented + out_params = {} + #out_params['job'] = # TODO (type REF (pywbem.CIMInstanceName(classname='CIM_ConcreteJob', ...)) + rval = None # TODO (type pywbem.Uint32 self.Values.RequestStateChange) + return (rval, out_params) + + class Values(object): + class Status(object): + OK = 'OK' + Error = 'Error' + Degraded = 'Degraded' + Unknown = 'Unknown' + Pred_Fail = 'Pred Fail' + Starting = 'Starting' + Stopping = 'Stopping' + Service = 'Service' + Stressed = 'Stressed' + NonRecover = 'NonRecover' + No_Contact = 'No Contact' + Lost_Comm = 'Lost Comm' + Stopped = 'Stopped' + + class RequestedState(object): + Enabled = pywbem.Uint16(2) + Disabled = pywbem.Uint16(3) + Shut_Down = pywbem.Uint16(4) + No_Change = pywbem.Uint16(5) + Offline = pywbem.Uint16(6) + Test = pywbem.Uint16(7) + Deferred = pywbem.Uint16(8) + Quiesce = pywbem.Uint16(9) + Reboot = pywbem.Uint16(10) + Reset = pywbem.Uint16(11) + Not_Applicable = pywbem.Uint16(12) + # DMTF_Reserved = .. + # Vendor_Reserved = 32768..65535 + + class HealthState(object): + Unknown = pywbem.Uint16(0) + OK = pywbem.Uint16(5) + Degraded_Warning = pywbem.Uint16(10) + Minor_failure = pywbem.Uint16(15) + Major_failure = pywbem.Uint16(20) + Critical_failure = pywbem.Uint16(25) + Non_recoverable_error = pywbem.Uint16(30) + # DMTF_Reserved = .. + + class EnabledDefault(object): + Enabled = pywbem.Uint16(2) + Disabled = pywbem.Uint16(3) + Not_Applicable = pywbem.Uint16(5) + Enabled_but_Offline = pywbem.Uint16(6) + No_Default = pywbem.Uint16(7) + Quiesce = pywbem.Uint16(9) + # DMTF_Reserved = .. + # Vendor_Reserved = 32768..65535 + + class EnabledState(object): + Unknown = pywbem.Uint16(0) + Other = pywbem.Uint16(1) + Enabled = pywbem.Uint16(2) + Disabled = pywbem.Uint16(3) + Shutting_Down = pywbem.Uint16(4) + Not_Applicable = pywbem.Uint16(5) + Enabled_but_Offline = pywbem.Uint16(6) + In_Test = pywbem.Uint16(7) + Deferred = pywbem.Uint16(8) + Quiesce = pywbem.Uint16(9) + Starting = pywbem.Uint16(10) + # DMTF_Reserved = 11..32767 + # Vendor_Reserved = 32768..65535 + + class ComplexPasswordRulesEnforced(object): + Minimum_Length = pywbem.Uint16(2) + Preclude_User_ID_Inclusion = pywbem.Uint16(3) + Maximum_Repeating_Characters = pywbem.Uint16(4) + Lower_Case_Alpha = pywbem.Uint16(5) + Upper_Case_Alpha = pywbem.Uint16(6) + Numeric_Character = pywbem.Uint16(7) + Special_Character = pywbem.Uint16(8) + # DMTF_Reserved = .. + # Vendor_Reserved = 0x8000..0xFFFF + + class OperationalStatus(object): + Unknown = pywbem.Uint16(0) + Other = pywbem.Uint16(1) + OK = pywbem.Uint16(2) + Degraded = pywbem.Uint16(3) + Stressed = pywbem.Uint16(4) + Predictive_Failure = pywbem.Uint16(5) + Error = pywbem.Uint16(6) + Non_Recoverable_Error = pywbem.Uint16(7) + Starting = pywbem.Uint16(8) + Stopping = pywbem.Uint16(9) + Stopped = pywbem.Uint16(10) + In_Service = pywbem.Uint16(11) + No_Contact = pywbem.Uint16(12) + Lost_Communication = pywbem.Uint16(13) + Aborted = pywbem.Uint16(14) + Dormant = pywbem.Uint16(15) + Supporting_Entity_in_Error = pywbem.Uint16(16) + Completed = pywbem.Uint16(17) + Power_Mode = pywbem.Uint16(18) + # DMTF_Reserved = .. + # Vendor_Reserved = 0x8000.. + + class RequestStateChange(object): + Completed_with_No_Error = pywbem.Uint32(0) + Not_Supported = pywbem.Uint32(1) + Unknown_or_Unspecified_Error = pywbem.Uint32(2) + Cannot_complete_within_Timeout_Period = pywbem.Uint32(3) + Failed = pywbem.Uint32(4) + Invalid_Parameter = pywbem.Uint32(5) + In_Use = pywbem.Uint32(6) + # DMTF_Reserved = .. + Method_Parameters_Checked___Job_Started = pywbem.Uint32(4096) + Invalid_State_Transition = pywbem.Uint32(4097) + Use_of_Timeout_Parameter_Not_Supported = pywbem.Uint32(4098) + Busy = pywbem.Uint32(4099) + # Method_Reserved = 4100..32767 + # Vendor_Specific = 32768..65535 + class RequestedState(object): + Enabled = pywbem.Uint16(2) + Disabled = pywbem.Uint16(3) + Shut_Down = pywbem.Uint16(4) + Offline = pywbem.Uint16(6) + Test = pywbem.Uint16(7) + Defer = pywbem.Uint16(8) + Quiesce = pywbem.Uint16(9) + Reboot = pywbem.Uint16(10) + Reset = pywbem.Uint16(11) + # DMTF_Reserved = .. + # Vendor_Reserved = 32768..65535 + +## end of class OMC_AccountProvider + +def get_providers(env): + omc_account_prov = OMC_AccountProvider(env) + return {'OMC_Account': omc_account_prov} Property changes on: pyprofiles/simpleIdentity/OMC_Account.py ___________________________________________________________________ Name: svn:executable + * Added: pyprofiles/simpleIdentity/OMC_Account.reg =================================================================== --- pyprofiles/simpleIdentity/OMC_Account.reg (rev 0) +++ pyprofiles/simpleIdentity/OMC_Account.reg 2007-09-10 16:38:45 UTC (rev 488) @@ -0,0 +1,9 @@ +// Provider registration for OMC_Account +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_Account:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_Account"; + ProviderTypes = {1,6}; // Instance, Method + ModulePath = "/usr/lib/pycim/OMC_Account.py"; +}; Property changes on: pyprofiles/simpleIdentity/OMC_Account.reg ___________________________________________________________________ Name: svn:executable + * Added: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.mof =================================================================== --- pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.mof (rev 0) +++ pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.mof 2007-09-10 16:38:45 UTC (rev 488) @@ -0,0 +1,11 @@ +[Association,Description("Relationship between a UserAccountService and UserAccountCapabilities")] +class OMC_AccountElementCapabilities : CIM_ElementCapabilities +{ + [Key,Description ("Capabilities of the User Account service")] + OMC_AccountManagementCapabilities REF Capabilities; + + [Key, Min(1),Description ("The user account service")] + OMC_UserAccountManagementService REF ManagedElement; + + +}; Property changes on: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.mof ___________________________________________________________________ Name: svn:executable + * Added: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py =================================================================== --- pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py (rev 0) +++ pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py 2007-09-10 16:38:45 UTC (rev 488) @@ -0,0 +1,286 @@ +"""Python Provider for OMC_AccountElementCapabilities + +Instruments the CIM class OMC_AccountElementCapabilities + +""" + +import pywbem + +class OMC_AccountElementCapabilitiesProvider(pywbem.CIMProvider): + """Instrument the CIM class OMC_AccountElementCapabilities + + Relationship between a UserAccountService and UserAccountCapabilities + + """ + + 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__) + + #model['Characteristics'] = # TODO (type = [pywbem.Uint16,] self.Values.Characteristics) + 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__) + ch = env.get_cimom_handle() + """ There is always one instance of OMC_AccountManagementCapbility which has instanceID: OMC:AccountCapability """ + capabilityInstanceName = pywbem.CIMInstanceName(classname='OMC_AccountManagementCapabilities', + namespace=model.path.namespace, + keybindings={'InstanceID':'OMC:AccountCapability'}) + model['Capabilities'] = capabilityInstanceName + serviceList = [] + try: + """All the instances of OMC_UserAccountManagementService will be associated with OMC_AccountManagementCapbility which has instanceID: OMC:AccountCapability """ + ch.EnumerateInstances('OMC_UserAccountManagementService', model.path.namespace, IncludeQualifiers=False, Handler=lambda inst:serviceList.append(inst)) + except: + return + for serviceInstance in serviceList: + if(serviceInstance['CreationClassName'] == 'OMC_UserAccountManagementService'): + model['ManagedElement'] = serviceInstance.path + 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() + # This is a common pattern. YMMV + if (not role or role.lower() == 'capabilities') and \ + pywbem.is_subclass(ch, object_name.namespace, + sub=object_name.classname, + super='OMC_AccountManagementCapabilities'): + model['Capabilities'] = object_name + serviceList = [] + try: + """All the instances of OMC_UserAccountManagementService will be associated with OMC_AccountManagementCapbility which has instanceID: OMC:AccountCapability """ + ch.EnumerateInstances('OMC_UserAccountManagementService', model.path.namespace, IncludeQualifiers=False, Handler=lambda inst:serviceList.append(inst)) + except: + return + for serviceInstance in serviceList: + if(serviceInstance['CreationClassName'] == 'OMC_UserAccountManagementService'): + model['ManagedElement'] = serviceInstance.path + yield model # TODO: Yield association instances where + # object_name is capabilities. + # Only appropriate if object_name.classname + # is 'OMC_AccountManagementCapabilities' or a subclass. + + if (not role or role.lower() == 'managedelement') and \ + pywbem.is_subclass(ch, object_name.namespace, + sub=object_name.classname, + super='OMC_UserAccountManagementService'): + model['ManagedElement'] = object_name + capabilityList = [] + try: + """All the instances of OMC_UserAccountManagementService will be associated with OMC_AccountManagementCapbility which has instanceID: OMC:AccountCapability """ + ch.EnumerateInstances('OMC_AccountManagementCapabilities', model.path.namespace, IncludeQualifiers=False, Handler=lambda inst:capabilityList.append(inst)) + except: + return + for capabilityInstance in capabilityList: + if(capabilityInstance['InstanceID'] == 'OMC:AccountCapability'): + model['Capabilities'] = capabilityInstance.path + yield model # TODO: Yield association instances where + # object_name is managedelement. + # Only appropriate if object_name.classname + # is 'OMC_UserAccountManagementService' or a subclass. + + class Values(object): + class Characteristics(object): + Default = pywbem.Uint16(2) + Current = pywbem.Uint16(3) + # DMTF_Reserved = .. + # Vendor_Specific = 32768..65535 + +## end of class OMC_AccountElementCapabilitiesProvider + +def get_providers(env): + omc_accountelementcapabilities_prov = OMC_AccountElementCapabilitiesProvider(env) + return {'OMC_AccountElementCapabilities': omc_accountelementcapabilities_prov} Property changes on: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.py ___________________________________________________________________ Name: svn:executable + * Added: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.reg =================================================================== --- pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.reg (rev 0) +++ pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.reg 2007-09-10 16:38:45 UTC (rev 488) @@ -0,0 +1,9 @@ +// Provider registration for OMC_ElementCapabilities +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_AccountElementCapabilities:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_AccountElementCapabilities"; + ProviderTypes = {1,3}; // Instance, Associator + ModulePath = "/usr/lib/pycim/OMC_AccountElementCapabilities.py"; +}; Property changes on: pyprofiles/simpleIdentity/OMC_AccountElementCapabilities.reg ___________________________________________________________________ Name: svn:executable + * Added: pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.mof =================================================================== --- pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.mof (rev 0) +++ pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.mof 2007-09-10 16:38:45 UTC (rev 488) @@ -0,0 +1,14 @@ +// <change cr="WIPCR00316.003" type="add">new class.</change> +// ================================================================== +// OMC_AccountManagementCapabilities +// ================================================================== +[Description ( + "AccountManagementCapabilities describes the capabilities " + "supported for managing Accounts associated with an instance of " + "AccountManagementService. AccountManagementCapabilities is " + "associated with an instance of AccountManagementService " + "through the ElementCapabilities association.")] +class OMC_AccountManagementCapabilities : CIM_AccountManagementCapabilities { + +}; + Property changes on: pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.mof ___________________________________________________________________ Name: svn:executable + * Added: pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py =================================================================== --- pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py (rev 0) +++ pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py 2007-09-10 16:38:45 UTC (rev 488) @@ -0,0 +1,355 @@ +"""Python Provider for OMC_AccountManagementCapabilities + +Instruments the CIM class OMC_AccountManagementCapabilities + +""" + +import pywbem +import pwd + +class OMC_AccountManagementCapabilitiesProvider(pywbem.CIMProvider): + """Instrument the CIM class OMC_AccountManagementCapabilities + + AccountManagementCapabilities describes the capabilities supported for + managing Accounts associated with an instance of + AccountManagementService. AccountManagementCapabilities is associated + with an instance of AccountManagementService through the + ElementCapabilities association. + + """ + + 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__) + + #model['Caption'] = # TODO (type = unicode) + #model['Description'] = # TODO (type = unicode) + #model['ElementName'] = # TODO (type = unicode) (Required) + #model['ElementNameEditSupported'] = # TODO (type = bool) + #model['ElementNameMask'] = # TODO (type = unicode) + #model['MaxElementNameLen'] = # TODO (type = pywbem.Uint16) + #model['OperationsSupported'] = # TODO (type = [pywbem.Uint16,] self.Values.OperationsSupported) + model['ElementName'] = 'AccountManagementCapability' + model['ElementNameEditSupported'] = False + 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 true: # TODO more instances? + # TODO fetch system resource + # Key properties + model['InstanceID'] = 'OMC:AccountCapability' + 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 cim_method_creategoalsettings(self, env, object_name, method, + param_supportedgoalsettings, + param_templategoalsettings): + """Implements OMC_AccountManagementCapabilities.CreateGoalSettings() + + Method to create a set of supported SettingData elements, from two + sets of SettingData elements, provided by the caller. CreateGoal + should be used when the SettingData instances that represents the + goal will not persist beyond the execution of the client and where + those instances are not intended to be shared with other, + non-cooperating clients. Both TemplateGoalSettings and + SupportedGoalSettings are represented as strings containing + EmbeddedInstances of a CIM_SettingData subclass. These embedded + instances do not exist in the infrastructure supporting this + method but are maintained by the caller/client. This method + should return CIM_Error(s) representing that a single named + property of a setting (or other) parameter (either reference or + embedded object) has an invalid value or that an invalid + combination of named properties of a setting (or other) parameter + (either reference or embedded object) has been requested. If the + input TemplateGoalSettings is NULL or the empty string, this + method returns a default SettingData element that is supported by + this Capabilities element. If the TemplateGoalSettings specifies + values that cannot be supported, this method shall return an + appropriate CIM_Error and should return a best match for a + SupportedGoalSettings. The client proposes a goal using the + TemplateGoalSettings parameter and gets back Success if the + TemplateGoalSettings is exactly supportable. It gets back + "Alternative Proposed" if the output SupportedGoalSettings + represents a supported alternative. This alternative should be a + best match, as defined by the implementation. If the + implementation is conformant to a RegisteredProfile, then that + profile may specify the algorithms used to determine best match. A + client may compare the returned value of each property against the + requested value to determine if it is left unchanged, degraded or + upgraded. Otherwise, if the TemplateGoalSettings is not + applicable an "Invalid Parameter" error is returned. When a + mutually acceptable SupportedGoalSettings has been achieved, the + client may use the contained SettingData instances as input to + methods for creating a new object ormodifying an existing object. + Also the embedded SettingData instances returned in the + SupportedGoalSettings may be instantiated via CreateInstance, + either by a client or as a side-effect of the execution of an + extrinsic method for which the returned SupportedGoalSettings is + passed as an embedded instance. + + Keyword arguments: + env -- Provider Environment (pycimmb.ProviderEnvironment) + object_name -- A pywbem.CIMInstanceName or pywbem.CIMCLassName + specifying the object on which the method CreateGoalSettings() + should be invoked. + method -- A pywbem.CIMMethod representing the method meta-data + param_supportedgoalsettings -- The input parameter SupportedGoalSettings (type pywbem.CIMInstance(classname='CIM_SettingData', ...)) + SupportedGoalSettings are elements of class CIM_SettingData, or + a derived class. At most, one instance of each SettingData + subclass may be supplied. All SettingData instances provided + by this property are interpreted as a set, relative to this + Capabilities instance. To enable a client to provide + additional information towards achieving the + TemplateGoalSettings, an input set of SettingData instances + may be provided. If not provided, this property shall be set + to NULL on input.. Note that when provided, what property + values are changed, and how, is implementation dependent and + may be the subject of other standards. If provided, the input + SettingData instances must be ones that the implementation is + able to support relative to the ManagedElement associated via + ElementCapabilities. Typically, the input SettingData + instances are created by a previous instantiation of + CreateGoalSettings. If the input SupportedGoalSettings is not + supported by the implementation, then an "Invalid Parameter" + (5) error is returned by this call. In this case, a + corresponding CIM_ERROR should also be returned. On output, + this property is used to return the best supported match to + the TemplateGoalSettings. If the output SupportedGoalSettings + matches the input SupportedGoalSettings, then the + implementation is unable to improve further towards meeting + the TemplateGoalSettings. + + param_templategoalsettings -- The input parameter TemplateGoalSettings (type pywbem.CIMInstance(classname='CIM_SettingData', ...)) + If provided, TemplateGoalSettings are elements of class + CIM_SettingData, or a derived class, that is used as the + template to be matched. . At most, one instance of each + SettingData subclass may be supplied. All SettingData + instances provided by this property are interpreted as a set, + relative to this Capabilities instance. SettingData instances + that are not relevant to this instance are ignored. If not + provided, it shall be set to NULL. In that case, a SettingData + instance representing the default settings of the associated + ManagedElement is used. + + + Returns a two-tuple containing the return value (type pywbem.Uint16 self.Values.CreateGoalSettings) + and a dictionary with the out-parameters + + Output parameters: + SupportedGoalSettings -- (type pywbem.CIMInstance(classname='CIM_SettingData', ...)) + SupportedGoalSettings are elements of class CIM_SettingData, or + a derived class. At most, one instance of each SettingData + subclass may be supplied. All SettingData instances provided + by this property are interpreted as a set, relative to this + Capabilities instance. To enable a client to provide + additional information towards achieving the + TemplateGoalSettings, an input set of SettingData instances + may be provided. If not provided, this property shall be set + to NULL on input.. Note that when provided, what property + values are changed, and how, is implementation dependent and + may be the subject of other standards. If provided, the input + SettingData instances must be ones that the implementation is + able to support relative to the ManagedElement associated via + ElementCapabilities. Typically, the input SettingData + instances are created by a previous instantiation of + CreateGoalSettings. If the input SupportedGoalSettings is not + supported by the implementation, then an "Invalid Parameter" + (5) error is returned by this call. In this case, a + corresponding CIM_ERROR should also be returned. On output, + this property is used to return the best supported match to + the TemplateGoalSettings. If the output SupportedGoalSettings + matches the input SupportedGoalSettings, then the + implementation is unable to improve further towards meeting + the TemplateGoalSettings. + + + Possible Errors: + CIM_ERR_ACCESS_DENIED + CIM_ERR_INVALID_PARAMETER (including missing, duplicate, + unrecognized or otherwise incorrect parameters) + CIM_ERR_NOT_FOUND (the target CIM Class or instance does not + exist in the specified namespace) + CIM_ERR_METHOD_NOT_AVAILABLE (the CIM Server is unable to honor + the invocation request) + CIM_ERR_FAILED (some other unspecified error occurred) + + """ + + logger = env.get_logger() + logger.log_debug('Entering %s.cim_method_creategoalsettings()' \ + % self.__class__.__name__) + + # TODO do something + raise pywbem.CIMError(pywbem.CIM_ERR_METHOD_NOT_AVAILABLE) # Remove to implemented + out_params = {} + #out_params['supportedgoalsettings'] = # TODO (type pywbem.CIMInstance(classname='CIM_SettingData', ...)) + rval = None # TODO (type pywbem.Uint16 self.Values.CreateGoalSettings) + return (rval, out_params) + + class Values(object): + class RequestedStatesSupported(object): + Enabled = pywbem.Uint16(2) + Disabled = pywbem.Uint16(3) + Shut_Down = pywbem.Uint16(4) + Offline = pywbem.Uint16(6) + Test = pywbem.Uint16(7) + Defer = pywbem.Uint16(8) + Quiesce = pywbem.Uint16(9) + Reboot = pywbem.Uint16(10) + Reset = pywbem.Uint16(11) + + class CreateGoalSettings(object): + Success = pywbem.Uint16(0) + Not_Supported = pywbem.Uint16(1) + Unknown = pywbem.Uint16(2) + Timeout = pywbem.Uint16(3) + Failed = pywbem.Uint16(4) + Invalid_Parameter = pywbem.Uint16(5) + Alternative_Proposed = pywbem.Uint16(6) + # DMTF_Reserved = .. + # Vendor_Specific = 32768..65535 + + class OperationsSupported(object): + Create = pywbem.Uint16(2) + Modify = pywbem.Uint16(3) + Delete = pywbem.Uint16(4) + # DMTF_Reserved = .. + # Vendor_Reserved = 0x8000..0xFFFF + +## end of class OMC_AccountManagementCapabilitiesProvider + +def get_providers(env): + omc_accountmanagementcapabilities_prov = OMC_AccountManagementCapabilitiesProvider(env) + return {'OMC_AccountManagementCapabilities': omc_accountmanagementcapabilities_prov} Property changes on: pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.py ___________________________________________________________________ Name: svn:executable + * Added: pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.reg =================================================================== --- pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.reg (rev 0) +++ pyprofiles/simpleIdentity/OMC_AccountManagementCapabilities.reg 2007-09-10 16:38:45 UTC (rev 488) @@ -0,0 +1,9 @@ +// Provider registration for OMC_AccountManagementCapabilities +instance of OpenWBEM_PyProviderRegistration +{ + InstanceID = "OMC:OMC_AccountManagementCapabilities:01"; + NamespaceNames = {"root/cimv2"}; + ClassName = "OMC_AccountManagementCapabilities"; + P... [truncated message content] |
From: <np...@us...> - 2007-09-10 16:37:54
|
Revision: 487 http://omc.svn.sourceforge.net/omc/?rev=487&view=rev Author: npaxton Date: 2007-09-10 09:37:58 -0700 (Mon, 10 Sep 2007) Log Message: ----------- omctools version updates Modified Paths: -------------- tools/trunk/configure.ac tools/trunk/omctools.spec Modified: tools/trunk/configure.ac =================================================================== --- tools/trunk/configure.ac 2007-09-10 16:37:15 UTC (rev 486) +++ tools/trunk/configure.ac 2007-09-10 16:37:58 UTC (rev 487) @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(omctools, 1.0.2) -AM_INIT_AUTOMAKE(omctools, 1.0.2) +AC_INIT(omctools, 1.0.3) +AM_INIT_AUTOMAKE(omctools, 1.0.3) AC_CONFIG_SRCDIR([cimtester/src/getInstanceTest.cpp]) AC_CONFIG_HEADER([config.h]) Modified: tools/trunk/omctools.spec =================================================================== --- tools/trunk/omctools.spec 2007-09-10 16:37:15 UTC (rev 486) +++ tools/trunk/omctools.spec 2007-09-10 16:37:58 UTC (rev 487) @@ -2,8 +2,8 @@ Name: omctools BuildRequires: gcc-c++ openwbem-devel openssl-devel readline-devel BuildRoot: %{_tmppath}/%{name}-%{version}-build -Version: 1.0.1 -Release: 2 +Version: 1.0.3 +Release: 1 License: LGPL #Copyright: Novell Inc. Group: System/Management This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <np...@us...> - 2007-09-10 16:37:29
|
Revision: 486 http://omc.svn.sourceforge.net/omc/?rev=486&view=rev Author: npaxton Date: 2007-09-10 09:37:15 -0700 (Mon, 10 Sep 2007) Log Message: ----------- minor changes to configure.ac Modified Paths: -------------- cmpibase/trunk/configure.ac Modified: cmpibase/trunk/configure.ac =================================================================== --- cmpibase/trunk/configure.ac 2007-09-10 16:20:08 UTC (rev 485) +++ cmpibase/trunk/configure.ac 2007-09-10 16:37:15 UTC (rev 486) @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(omccmpi, 1.0.1) +AC_INIT(cmpibase, 1.0.0) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src]) AC_CONFIG_HEADER([config.h]) @@ -153,7 +153,7 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h sys/time.h openssl/evp.h sys/param.h sys/vfs.h],,[AC_MSG_ERROR(Missing headers: likely won't compile)]) +AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h sys/time.h sys/param.h sys/vfs.h],,[AC_MSG_ERROR(Missing headers: likely won't compile)]) AC_LANG_CPLUSPLUS AC_CHECK_HEADERS([cimple/cimple.h],[HAVE_CIMPLE="1"],[HAVE_CIMPLE="0"]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bc...@us...> - 2007-09-10 16:20:05
|
Revision: 485 http://omc.svn.sourceforge.net/omc/?rev=485&view=rev Author: bcwise Date: 2007-09-10 09:20:08 -0700 (Mon, 10 Sep 2007) Log Message: ----------- REMOVED commented out code. This code was commented out for debugging, but was not uncommented. CHANGED some of the references to structure elements, because the elements changed. Modified Paths: -------------- base/branches/1.0/src/providers/operating-system/linux_os.cpp Modified: base/branches/1.0/src/providers/operating-system/linux_os.cpp =================================================================== --- base/branches/1.0/src/providers/operating-system/linux_os.cpp 2007-09-05 14:27:05 UTC (rev 484) +++ base/branches/1.0/src/providers/operating-system/linux_os.cpp 2007-09-10 16:20:08 UTC (rev 485) @@ -126,7 +126,6 @@ * Function: read_distro_info * */ -#if 0 void read_distro_info() { @@ -141,7 +140,7 @@ output = ""; String cmd = "/bin/rpm -q "; - cmd += install_rpm_data[i].file.c_str(); + cmd += install_rpm_data[i].file; try { @@ -166,7 +165,7 @@ // and desc for all distros for(i = 0; i < INSTALL_FILE_DATA_SIZE; i++) { - ifstream ifstr(install_file_data[i].file.c_str(), std::ios::in); + ifstream ifstr(install_file_data[i].file, std::ios::in); if (!ifstr) { continue; @@ -220,7 +219,6 @@ g_bDistroInfoRead = true; } -#endif @@ -228,7 +226,6 @@ * Function: get_distro_name * */ -#if 0 String get_distro_name() { @@ -236,14 +233,12 @@ read_distro_info(); return g_cim_os_distro_name; } // get_distro_element_name() -#endif /*--------------------------------------------------------------------------- * Function: get_distro_element_name * */ -#if 0 String get_distro_element_name() { @@ -251,14 +246,12 @@ read_distro_info(); return g_cim_os_distro_element_name; } // get_distro_element_name() -#endif /*--------------------------------------------------------------------------- * Function: get_distro_desc * */ -#if 0 String get_distro_desc() { @@ -266,7 +259,6 @@ read_distro_info(); return g_cim_os_distro_desc; } // get_distro_desc() -#endif /*--------------------------------------------------------------------------- @@ -464,12 +456,8 @@ String LinuxOperatingSystem::getDescription() { -#if 0 //return "A class derived from OperatingSystem to represents the running Linux OS."; return get_distro_desc(); -#else - return String(""); -#endif } // LinuxOperatingSystem::getDescription() @@ -481,11 +469,7 @@ String LinuxOperatingSystem::getElementName() { -#if 0 return get_distro_element_name(); -#else - return String(); -#endif } // LinuxOperatingSystem::getElementName() @@ -497,11 +481,7 @@ String LinuxOperatingSystem::getDistroName() { -#if 0 return get_distro_name(); -#else - return String(); -#endif } // LinuxOperatingSystem::getDistroName() @@ -566,7 +546,6 @@ CIMDateTime LinuxOperatingSystem::getInstallDate() { -#if 0 int i; /* @@ -574,9 +553,9 @@ */ for(i = 0;i < (int) (sizeof(install_rpm_data) / sizeof(distro_file_t)); i++) { //if(strstr(CIM_OS_DISTRO, install_rpm_data[i].distro.c_str()) != NULL) { - if (get_distro_name().indexOf(install_rpm_data[i].distro.c_str()) != String::npos) { + if (get_distro_name().indexOf(install_rpm_data[i].distro) != String::npos) { String cmd = "/bin/rpm -q --queryformat %{INSTALLTIME} "; - cmd += install_rpm_data[i].file.c_str(); + cmd += install_rpm_data[i].file; PopenStreams pos = Exec::safePopen(cmd.tokenize()); String output = pos.out()->readAll(); @@ -597,17 +576,16 @@ #endif for(i = 0;i < (int) (sizeof(install_file_data) / sizeof(distro_file_t)); i++) { #if LOCAL_DEBUG - fprintf(stderr, "install_data: distro: %s\n", install_file_data[i].distro.c_str()); - fprintf(stderr, "install_data: file: %s\n", install_file_data[i].file.c_str()); + fprintf(stderr, "install_data: distro: %s\n", install_file_data[i].distro); + fprintf(stderr, "install_data: file: %s\n", install_file_data[i].file); #endif - if(install_file_data[i].file.length()) { + if(strlen(install_file_data[i].file)) { struct stat statbuf; - if(::stat(install_file_data[i].file.c_str(), &statbuf) == 0) { + if(::stat(install_file_data[i].file, &statbuf) == 0) { return CIMDateTime(DateTime((time_t) statbuf.st_mtime)); } } } -#endif return CIMDateTime(); } // LinuxOperatingSystem::getInstallDate() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bc...@us...> - 2007-09-05 14:27:08
|
Revision: 484 http://omc.svn.sourceforge.net/omc/?rev=484&view=rev Author: bcwise Date: 2007-09-05 07:27:05 -0700 (Wed, 05 Sep 2007) Log Message: ----------- Changed some structures that were using OpenWBEM Strings to c-style strings. This was used to fix a problem that was occuring when OpenWBEM was initializing the library. Some of the library's static data was found corrupting other data on the heap. Modified Paths: -------------- base/branches/1.0/src/providers/operating-system/linux_os.cpp base/branches/1.0/src/providers/operating-system/linuxos.cpp Modified: base/branches/1.0/src/providers/operating-system/linux_os.cpp =================================================================== --- base/branches/1.0/src/providers/operating-system/linux_os.cpp 2007-08-20 16:29:08 UTC (rev 483) +++ base/branches/1.0/src/providers/operating-system/linux_os.cpp 2007-09-05 14:27:05 UTC (rev 484) @@ -64,23 +64,23 @@ } meminfo_t; typedef struct { - String distro; // Distribution name. - String file; // rpm file name to check. + const char *distro; // Distribution name. + const char *file; // rpm file name to check. } distro_file_t; // List of distros & associated rpms that are installed (used to get install time). distro_file_t install_rpm_data[] = { - {"redhat", "redhat-release"}, + {"redhat", "redhat-release"}, {"redhat-as", "redhat-release-as"}, - {"sles", "sles-release"}, - {"suse", "suse-release"}, - {"sled", "sled-release"}, - {"fedora", "fedora-release"}, - {"mandrake","mandrake-release"}, - {"mandriva","mandriva-release"}, - {"freebsd", "freebsd-release"}, - {"centos", "centos-release"}, - {"xandros", "xandros-release"}, + {"sles", "sles-release"}, + {"suse", "suse-release"}, + {"sled", "sled-release"}, + {"fedora", "fedora-release"}, + {"mandrake", "mandrake-release"}, + {"mandriva", "mandriva-release"}, + {"freebsd", "freebsd-release"}, + {"centos", "centos-release"}, + {"xandros", "xandros-release"}, }; #define INSTALL_RPM_DATA_SIZE ((int)(sizeof(install_rpm_data) / sizeof(distro_file_t))) @@ -126,6 +126,7 @@ * Function: read_distro_info * */ +#if 0 void read_distro_info() { @@ -219,6 +220,7 @@ g_bDistroInfoRead = true; } +#endif @@ -226,6 +228,7 @@ * Function: get_distro_name * */ +#if 0 String get_distro_name() { @@ -233,12 +236,14 @@ read_distro_info(); return g_cim_os_distro_name; } // get_distro_element_name() +#endif /*--------------------------------------------------------------------------- * Function: get_distro_element_name * */ +#if 0 String get_distro_element_name() { @@ -246,12 +251,14 @@ read_distro_info(); return g_cim_os_distro_element_name; } // get_distro_element_name() +#endif /*--------------------------------------------------------------------------- * Function: get_distro_desc * */ +#if 0 String get_distro_desc() { @@ -259,6 +266,7 @@ read_distro_info(); return g_cim_os_distro_desc; } // get_distro_desc() +#endif /*--------------------------------------------------------------------------- @@ -456,8 +464,12 @@ String LinuxOperatingSystem::getDescription() { +#if 0 //return "A class derived from OperatingSystem to represents the running Linux OS."; return get_distro_desc(); +#else + return String(""); +#endif } // LinuxOperatingSystem::getDescription() @@ -469,7 +481,11 @@ String LinuxOperatingSystem::getElementName() { +#if 0 return get_distro_element_name(); +#else + return String(); +#endif } // LinuxOperatingSystem::getElementName() @@ -481,7 +497,11 @@ String LinuxOperatingSystem::getDistroName() { +#if 0 return get_distro_name(); +#else + return String(); +#endif } // LinuxOperatingSystem::getDistroName() @@ -546,6 +566,7 @@ CIMDateTime LinuxOperatingSystem::getInstallDate() { +#if 0 int i; /* @@ -586,6 +607,7 @@ } } } +#endif return CIMDateTime(); } // LinuxOperatingSystem::getInstallDate() @@ -639,7 +661,6 @@ } return CIMDateTime(); - } // LinuxOperatingSystem::getLocalDateTime() @@ -827,8 +848,12 @@ String LinuxOperatingSystem::getOtherTypeDescription() { +#if 1 char *s = ""; return s; +#else + return String(); +#endif } // LinuxOperatingSystem::getOtherTypeDescription() @@ -935,7 +960,11 @@ String LinuxOperatingSystem::getStatus() { +#if 1 return("NULL"); +#else + return String(); +#endif } // LinuxOperatingSystem::getStatus() @@ -990,6 +1019,7 @@ LinuxOperatingSystem::getVersion() { +#if 1 struct utsname puname; String rval = ""; @@ -1000,6 +1030,9 @@ rval = puname.release; return rval; +#else + return String(); +#endif } // LinuxOperatingSystem::getVersion() Modified: base/branches/1.0/src/providers/operating-system/linuxos.cpp =================================================================== --- base/branches/1.0/src/providers/operating-system/linuxos.cpp 2007-08-20 16:29:08 UTC (rev 483) +++ base/branches/1.0/src/providers/operating-system/linuxos.cpp 2007-09-05 14:27:05 UTC (rev 484) @@ -271,7 +271,7 @@ const CIMClass &cimClass ) { #if LOCAL_DEBUG - cout << "\n\n**** enumInstances\n\n"; + DebugPrintFunctionEnter("enumInstances"); #endif CIMInstance inst = CreateLinuxOSInst(cimClass); @@ -317,7 +317,8 @@ DebugPrintFunctionEnter("getInstance"); #endif - CIMInstance inst = CreateLinuxOSInst(cimClass); + CIMInstance inst = cimClass.newInstance(); + return inst.clone(localOnly, includeQualifiers, includeClassOrigin, propertyList); } // getInstance() @@ -610,16 +611,17 @@ CIMInstance instance = cimClass.newInstance(); lib_proc_stat_map_t *lib_proc_stat_map; - procStat.GetProcStatMap(&lib_proc_stat_map); - #if LOCAL_DEBUG DebugPrintFunctionEnter("CreateLinuxOSInst"); #endif + procStat.GetProcStatMap(&lib_proc_stat_map); + instance.setProperty("CSCreationClassName", CIMValue(getComputerSystemClassName())); instance.setProperty("CSName", CIMValue(getComputerSystemName())); instance.setProperty("CreationClassName", CIMValue(getOperatingSystemClassName())); instance.setProperty("Name", CIMValue(getOperatingSystemName())); + // can't currently use this, because Process uses hard-coded object paths with 'Linux' // need to fix that, then change this. //instance.setProperty("Name", CIMValue(los_obj.getDistroName())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jc...@us...> - 2007-08-20 16:29:06
|
Revision: 483 http://omc.svn.sourceforge.net/omc/?rev=483&view=rev Author: jcarey Date: 2007-08-20 09:29:08 -0700 (Mon, 20 Aug 2007) Log Message: ----------- Removed the code that set the process to a new process group. This allow child procs to die along with the parent process. Modified Paths: -------------- omccmpi/trunk/src/lib/omc/exec.c Modified: omccmpi/trunk/src/lib/omc/exec.c =================================================================== --- omccmpi/trunk/src/lib/omc/exec.c 2007-08-20 16:20:56 UTC (rev 482) +++ omccmpi/trunk/src/lib/omc/exec.c 2007-08-20 16:29:08 UTC (rev 483) @@ -259,9 +259,6 @@ i--; } - /* Set this process and all of it's children in a new proces group */ - setpgid(0, 0); - if (envp) { execve(argv[0], argv, envp); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |