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: <bni...@us...> - 2008-09-29 22:56:49
|
Revision: 1053 http://omc.svn.sourceforge.net/omc/?rev=1053&view=rev Author: bnicholes Date: 2008-09-29 22:56:32 +0000 (Mon, 29 Sep 2008) Log Message: ----------- Add StartMode, Started and InstallDate properties Modified Paths: -------------- pybase/trunk/OMC_InitdService.py Modified: pybase/trunk/OMC_InitdService.py =================================================================== --- pybase/trunk/OMC_InitdService.py 2008-09-29 20:57:08 UTC (rev 1052) +++ pybase/trunk/OMC_InitdService.py 2008-09-29 22:56:32 UTC (rev 1053) @@ -38,7 +38,7 @@ import pywbem from pywbem.cim_provider2 import CIMProvider2 import os -from subprocess import call +from subprocess import call, Popen, PIPE from socket import getfqdn def _blacklist(file): @@ -79,6 +79,31 @@ return False +#------------------------------------------------------------------------------ +def _get_rpm_install_date(fullpath): + try: + l=subprocess.Popen([r'/bin/rpm', '-qf', '--queryformat', \ + '%{INSTALLTIME}', fullpath], \ + stdout=subprocess.PIPE).communicate()[0] + if len(l): + return pywbem.CIMDateTime.fromtimestamp(long(l)) + except: + pass + return None + +#------------------------------------------------------------------------------ +def _is_auto_start(name): + try: + l=subprocess.Popen([r'/usr/bin/find', '/etc/init.d', '-name', \ + 'S[0-9][0-9]%s'%name], \ + stdout=subprocess.PIPE).communicate()[0] + if l.endswith('\n'): + l = l[0:-1] + return len(l.split()) > 0 + except: + pass + return False + class OMC_InitdServiceProvider(CIMProvider2): """Instrument the CIM class OMC_InitdService @@ -103,7 +128,6 @@ #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['InstallDate'] = # TODO (type = pywbem.CIMDateTime) fullpath = '/etc/init.d/' + model['name'] if not filtered and (_blacklist(model['name']) or not os.path.isfile(fullpath)): @@ -119,6 +143,10 @@ model['Caption'] = caption model['Description'] = caption + idt = _get_rpm_install_date(fullpath) + if idt: + model['InstallDate'] = idt + osts = [] cmd = fullpath + ' status' st = call(cmd, shell=True) @@ -136,6 +164,9 @@ if osts: model['OperationalStatus'] = osts + model['StartMode'] = _is_auto_start(model['name']) and 'Automatic' or 'Manual' + svcStarted = (st == self.Values.ServiceStatus.Service_Running) + model['Started'] = svcStarted #model['OperationalStatus'] = # TODO (type = [pywbem.Uint16,] self.Values.OperationalStatus) #model['OtherEnabledState'] = # TODO (type = unicode) #model['RequestedState'] = # TODO (type = pywbem.Uint16 self.Values.RequestedState) (default=12L) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2008-09-29 20:57:38
|
Revision: 1052 http://omc.svn.sourceforge.net/omc/?rev=1052&view=rev Author: kkaempf Date: 2008-09-29 20:57:08 +0000 (Mon, 29 Sep 2008) Log Message: ----------- - refactor cmpi_provider_{python,ruby}.c, move common lines (75%) to cmpi_provider.c and target language specific lines (25%) to target_{python,ruby}.c Modified Paths: -------------- cmpi-bindings/trunk/CMakeLists.txt cmpi-bindings/trunk/package/cmpi-bindings.changes cmpi-bindings/trunk/src/CMakeLists.txt cmpi-bindings/trunk/swig/cmpi.i cmpi-bindings/trunk/swig/cmpi_types.i Added Paths: ----------- cmpi-bindings/trunk/src/cmpi_provider.c cmpi-bindings/trunk/src/target_python.c cmpi-bindings/trunk/src/target_ruby.c Removed Paths: ------------- cmpi-bindings/trunk/src/cmpi_provider_python.c cmpi-bindings/trunk/src/cmpi_provider_ruby.c Modified: cmpi-bindings/trunk/CMakeLists.txt =================================================================== --- cmpi-bindings/trunk/CMakeLists.txt 2008-09-29 17:19:29 UTC (rev 1051) +++ cmpi-bindings/trunk/CMakeLists.txt 2008-09-29 20:57:08 UTC (rev 1052) @@ -35,7 +35,7 @@ INCLUDE(${CMAKE_SOURCE_DIR}/VERSION.cmake) -SET(CMAKE_VERBOSE_MAKEFILE TRUE) +SET(CMAKE_VERBOSE_MAKEFILE FALSE) SET( PACKAGE "cmpi-bindings" ) SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" ) Modified: cmpi-bindings/trunk/package/cmpi-bindings.changes =================================================================== --- cmpi-bindings/trunk/package/cmpi-bindings.changes 2008-09-29 17:19:29 UTC (rev 1051) +++ cmpi-bindings/trunk/package/cmpi-bindings.changes 2008-09-29 20:57:08 UTC (rev 1052) @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Sep 29 22:52:31 CEST 2008 - kk...@su... + +- refactor cmpi_provider_{python,ruby}.c, + move common lines (75%) to cmpi_provider.c and target language + specific lines (25%) to target_{python,ruby}.c + +------------------------------------------------------------------- Fri Sep 19 13:57:43 CEST 2008 - kk...@su... - rename .py filename to reflect 'pywbem' dependency. Modified: cmpi-bindings/trunk/src/CMakeLists.txt =================================================================== --- cmpi-bindings/trunk/src/CMakeLists.txt 2008-09-29 17:19:29 UTC (rev 1051) +++ cmpi-bindings/trunk/src/CMakeLists.txt 2008-09-29 20:57:08 UTC (rev 1052) @@ -5,7 +5,7 @@ SET( CMPI_INCLUDE_DIR /usr/include/cmpi ) SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -g" ) -SET(cmpi_provider_SRCS cmpi_provider_python.c cmpi_provider_ruby.c) +SET(cmpi_provider_SRCS cmpi_provider.c) ADD_DEFINITIONS(-DCMPI_PLATFORM_LINUX_GENERIC_GNU -DCMPI_VERSION=200) ADD_LIBRARY(cmpi_provider SHARED ${cmpi_provider_SRCS}) @@ -14,7 +14,7 @@ # -# Ruby +# Ruby: build standalone module, just for testing # ADD_DEFINITIONS(-DTARGET_RUBY) Copied: cmpi-bindings/trunk/src/cmpi_provider.c (from rev 1051, cmpi-bindings/trunk/src/cmpi_provider_python.c) =================================================================== --- cmpi-bindings/trunk/src/cmpi_provider.c (rev 0) +++ cmpi-bindings/trunk/src/cmpi_provider.c 2008-09-29 20:57:08 UTC (rev 1052) @@ -0,0 +1,1122 @@ +/***************************************************************************** +* Copyright (C) 2008 Novell Inc. All rights reserved. +* Copyright (C) 2008 SUSE Linux Products GmbH. 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 of SUSE Linux Products GmbH 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 SUSE Linux Products GmbH 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. +*****************************************************************************/ + +#include <stdio.h> +#include <stdarg.h> +#include <pthread.h> + +/* Include the required CMPI macros, data types, and API function headers */ +#include <cmpidt.h> +#include <cmpift.h> +#include <cmpimacs.h> + +// Needed to obtain errno of failed system calls +#include <errno.h> + +/* Needed for kill() */ +#include <signal.h> + +/* A simple stderr logging/tracing facility. */ +#ifndef _SBLIM_TRACE +#define _SBLIM_TRACE(tracelevel,args) _logstderr args +void _logstderr(char *fmt,...) +{ + va_list ap; + va_start(ap,fmt); + vfprintf(stderr,fmt,ap); + va_end(ap); + fprintf(stderr,"\n"); +} +#endif + + +SWIGEXPORT void SWIG_init(void); +#define _CMPI_SETFAIL(msgstr) {if (st != NULL) st->rc = CMPI_RC_ERR_FAILED; st->msg = msgstr; } + +/* +**============================================================================== +** +** Local definitions: +** +**============================================================================== +*/ + +/* + * per-MI struct to keep + * - name of MI + * - pointer to target instrumentation + * - pointer to Broker + */ + +typedef struct __ProviderMIHandle +{ + char *miName; + Target_Type tgMod; + const CMPIBroker* broker; +} ProviderMIHandle; + + +/* + * string2target + * char* -> Target_Type + */ + +static Target_Type +string2target(const char *s) +{ + if (s == NULL) + return Target_Null; + + Target_Type obj; + TARGET_THREAD_BEGIN_BLOCK; + + obj = Target_String(s); + TARGET_THREAD_END_BLOCK; + + return obj; +} + + +/* + * proplist2target + * char** -> Target_Type + */ + +static Target_Type +proplist2target(const char** cplist) +{ + TARGET_THREAD_BEGIN_BLOCK; + if (cplist == NULL) + { + Target_INCREF(Target_Void); + TARGET_THREAD_END_BLOCK; + return Target_Void; + } + Target_Type pl; + + pl = Target_Array(); + for (; (cplist!=NULL && *cplist != NULL); ++cplist) + { + Target_Append(pl, Target_String(*cplist)); + } + TARGET_THREAD_END_BLOCK; + + return pl; +} + + +static char * +fmtstr(const char* fmt, ...) +{ + va_list ap; + int len; + va_start(ap, fmt); + len = vsnprintf(NULL, 0, fmt, ap); + va_end(ap); + if (len <= 0) + { + return NULL; + } + char* str = (char*)malloc(len+1); + if (str == NULL) + { + return NULL; + } + va_start(ap, fmt); + vsnprintf(str, len+1, fmt, ap); + va_end(ap); + return str; +} + + +/* +**============================================================================== +** +** Local definitions: +** +**============================================================================== +*/ + +static int _MI_COUNT = 0; + +/* on-demand init */ +#define TARGET_CMPI_INIT { if (((ProviderMIHandle*)(self->hdl))->tgMod == Target_Null) if (TargetInitialize(((ProviderMIHandle*)(self->hdl)), &status) != 0) return status; } + +#if defined(SWIGPYTHON) +#include "target_python.c" +#endif + +#if defined(SWIGRUBY) +#include "target_ruby.c" +#endif + +/* + * Cleanup + * + */ + +static CMPIStatus +Cleanup( + ProviderMIHandle * miHdl, + const CMPIContext * context, + CMPIBoolean terminating) +{ + CMPIStatus status = {CMPI_RC_OK, NULL}; /* Return status of CIM operations. */ + + if (miHdl != NULL) + { + free(miHdl->miName); + + // we must free the miHdl - it is our ProviderMIHandle. + // it is pointed to by the CMPI<type>MI * that the broker holds onto... + // the broker is responsible for freeing the CMPI<type>MI* + free(miHdl); + miHdl = NULL; + } + + TargetCleanup(); + + _SBLIM_TRACE(1,("Cleanup() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +/* +**============================================================================== +** +** Provider Interface functions +** +**============================================================================== +*/ + +/* + * InstCleanup + */ + +static CMPIStatus +InstCleanup(CMPIInstanceMI * self, + const CMPIContext * context, + CMPIBoolean terminating) +{ + _SBLIM_TRACE(1,("Cleanup() called for Instance provider %s", ((ProviderMIHandle *)self->hdl)->miName)); + CMPIStatus st = Cleanup((ProviderMIHandle*)self->hdl, context, terminating); + return st; +} + + +/* + * AssocCleanup + */ + +static CMPIStatus +AssocCleanup(CMPIAssociationMI * self, + const CMPIContext * context, + CMPIBoolean terminating) +{ + _SBLIM_TRACE(1,("Cleanup() called for Association provider %s", ((ProviderMIHandle *)self->hdl)->miName)); + CMPIStatus st = Cleanup((ProviderMIHandle*)self->hdl, context, terminating); + return st; +} + + +/* + * MethodCleanup + */ + +static CMPIStatus +MethodCleanup(CMPIMethodMI * self, + const CMPIContext * context, + CMPIBoolean terminating) +{ + _SBLIM_TRACE(1,("Cleanup() called for Method provider %s", ((ProviderMIHandle *)self->hdl)->miName)); + CMPIStatus st = Cleanup((ProviderMIHandle*)self->hdl, context, terminating); + return st; +} + + +/* + * IndicationCleanup + */ + +static CMPIStatus +IndicationCleanup(CMPIIndicationMI * self, + const CMPIContext * context, + CMPIBoolean terminating) +{ + _SBLIM_TRACE(1,("Cleanup() called for Indication provider %s", ((ProviderMIHandle *)self->hdl)->miName)); + CMPIStatus st = Cleanup((ProviderMIHandle*)self->hdl, context, terminating); + return st; +} + +// ---------------------------------------------------------------------------- + + +/* + * EnumInstanceNames() - return a list of all the instances names (i.e. return their object paths only) + */ +static CMPIStatus +EnumInstanceNames(CMPIInstanceMI * self, + const CMPIContext * context, + const CMPIResult * result, + const CMPIObjectPath * reference) +{ + CMPIStatus status = {CMPI_RC_OK, NULL}; + + _SBLIM_TRACE(1,("EnumInstancesNames() called, context %p, result %p, reference %p", context, result, reference)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0); + Target_Type _result = SWIG_NewPointerObj((void*) result, SWIGTYPE_p__CMPIResult, 0); + Target_Type _reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0); + TARGET_THREAD_END_BLOCK; + + call_provider((ProviderMIHandle*)self->hdl, &status, "enum_instance_names", 3, + _context, + _result, + _reference); + + _SBLIM_TRACE(1,("EnumInstanceNames() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +// ---------------------------------------------------------------------------- + + +/* + * EnumInstances() - return a list of all the instances (i.e. return all the instance data) + */ +static CMPIStatus +EnumInstances(CMPIInstanceMI * self, + const CMPIContext * context, + const CMPIResult * result, + const CMPIObjectPath * reference, + const char ** properties) +{ + CMPIStatus status = {CMPI_RC_OK, NULL}; /* Return status of CIM operations */ + /* char * namespace = CMGetCharPtr(CMGetNameSpace(reference, NULL)); Our current CIM namespace */ + + _SBLIM_TRACE(1,("EnumInstances() called, context %p, result %p, reference %p, properties %p", context, result, reference, properties)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0); + Target_Type _result = SWIG_NewPointerObj((void*) result, SWIGTYPE_p__CMPIResult, 0); + Target_Type _reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0); + TARGET_THREAD_END_BLOCK; + Target_Type _properties = proplist2target(properties); + + call_provider((ProviderMIHandle*)self->hdl, &status, "enum_instances", 4, + _context, + _result, + _reference, + _properties); + + _SBLIM_TRACE(1,("EnumInstances() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +// ---------------------------------------------------------------------------- + + +/* + * GetInstance() - return the instance data for the specified instance only + */ +static CMPIStatus +GetInstance(CMPIInstanceMI * self, + const CMPIContext * context, + const CMPIResult * results, + const CMPIObjectPath * reference, + const char ** properties) +{ + CMPIStatus status = {CMPI_RC_OK, NULL}; /* Return status of CIM operations */ + + _SBLIM_TRACE(1,("GetInstance() called, context %p, results %p, reference %p, properties %p", context, results, reference, properties)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0); + Target_Type _result = SWIG_NewPointerObj((void*) results, SWIGTYPE_p__CMPIResult, 0); + Target_Type _reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0); + TARGET_THREAD_END_BLOCK; + Target_Type _properties = proplist2target(properties); + + call_provider((ProviderMIHandle*)self->hdl, &status, "get_instance", 4, + _context, + _result, + _reference, + _properties); + + _SBLIM_TRACE(1,("GetInstance() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +// ---------------------------------------------------------------------------- + + +/* + * CreateInstance() - create a new instance from the specified instance data. + */ +static CMPIStatus +CreateInstance(CMPIInstanceMI * self, + const CMPIContext * context, + const CMPIResult * results, + const CMPIObjectPath * reference, + const CMPIInstance * newinstance) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; /* Return status of CIM operations. */ + + /* Creating new instances is not supported for this class. */ + + _SBLIM_TRACE(1,("CreateInstance() called, context %p, results %p, reference %p, newinstance %p", context, results, reference, newinstance)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0); + Target_Type _result = SWIG_NewPointerObj((void*) results, SWIGTYPE_p__CMPIResult, 0); + Target_Type _reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0); + Target_Type _newinst = SWIG_NewPointerObj((void*) newinstance, SWIGTYPE_p__CMPIInstance, 0); + TARGET_THREAD_END_BLOCK; + + call_provider((ProviderMIHandle*)self->hdl, &status, "create_instance", 4, + _context, + _result, + _reference, + _newinst); + + _SBLIM_TRACE(1,("CreateInstance() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +// ---------------------------------------------------------------------------- + +#ifdef CMPI_VER_100 +#define SetInstance ModifyInstance +#endif + +/* + * SetInstance() - save modified instance data for the specified instance. + */ +static CMPIStatus +SetInstance(CMPIInstanceMI * self, + const CMPIContext * context, + const CMPIResult * results, + const CMPIObjectPath * reference, + const CMPIInstance * newinstance, + const char ** properties) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; /* Return status of CIM operations. */ + + /* Modifying existing instances is not supported for this class. */ + + _SBLIM_TRACE(1,("SetInstance() called, context %p, results %p, reference %p, newinstance %p, properties %p", context, results, reference, newinstance, properties)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0); + Target_Type _result = SWIG_NewPointerObj((void*) results, SWIGTYPE_p__CMPIResult, 0); + Target_Type _reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0); + Target_Type _newinst = SWIG_NewPointerObj((void*) newinstance, SWIGTYPE_p__CMPIInstance, 0); + TARGET_THREAD_END_BLOCK; + Target_Type plist = proplist2target(properties); + + call_provider((ProviderMIHandle*)self->hdl, &status, "set_instance", 5, + _context, + _result, + _reference, + _newinst, + plist); + + _SBLIM_TRACE(1,("SetInstance() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +/* ---------------------------------------------------------------------------- */ + +/* + * DeleteInstance() - delete/remove the specified instance. + */ +static CMPIStatus +DeleteInstance(CMPIInstanceMI * self, + const CMPIContext * context, + const CMPIResult * results, + const CMPIObjectPath * reference) +{ + CMPIStatus status = {CMPI_RC_OK, NULL}; + + _SBLIM_TRACE(1,("DeleteInstance() called, context %p, results %p, reference %p", context, results, reference)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0); + Target_Type _result = SWIG_NewPointerObj((void*) results, SWIGTYPE_p__CMPIResult, 0); + Target_Type _reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0); + TARGET_THREAD_END_BLOCK; + + call_provider((ProviderMIHandle*)self->hdl, &status, "delete_instance", 3, + _context, + _result, + _reference); + + _SBLIM_TRACE(1,("DeleteInstance() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +/* ---------------------------------------------------------------------------- */ + +/* + * ExecQuery() - return a list of all the instances that satisfy the desired query filter. + */ +static CMPIStatus +ExecQuery(CMPIInstanceMI * self, + const CMPIContext * context, + const CMPIResult * results, + const CMPIObjectPath * reference, + const char * query, + const char * language) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; /* Return status of CIM operations. */ + + _SBLIM_TRACE(1,("ExecQuery() called, context %p, results %p, reference %p, query %s, language %s", context, results, reference, query, language)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _context = SWIG_NewPointerObj((void*) context, SWIGTYPE_p__CMPIContext, 0); + Target_Type _result = SWIG_NewPointerObj((void*) results, SWIGTYPE_p__CMPIResult, 0); + Target_Type _reference = SWIG_NewPointerObj((void*) reference, SWIGTYPE_p__CMPIObjectPath, 0); + TARGET_THREAD_END_BLOCK; + Target_Type _query = string2target(query); + Target_Type _lang = string2target(language); + + call_provider((ProviderMIHandle*)self->hdl, &status, "exec_query", 5, + _context, + _result, + _reference, + _query, + _lang); + + /* Query filtering is not supported for this class. */ + + _SBLIM_TRACE(1,("ExecQuery() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +/* ---------------------------------------------------------------------------- + * CMPI external API + * ---------------------------------------------------------------------------- */ + +/* + * associatorMIFT + */ + +CMPIStatus +associatorNames( + CMPIAssociationMI* self, + const CMPIContext* ctx, + const CMPIResult* rslt, + const CMPIObjectPath* objName, + const char* assocClass, + const char* resultClass, + const char* role, + const char* resultRole) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; + + _SBLIM_TRACE(1,("associatorNames() called, ctx %p, rslt %p, objName %p, assocClass %s, resultClass %s, role %s, resultRole %s", ctx, rslt, objName, assocClass, resultClass, role, resultRole)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0); + Target_Type _rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0); + Target_Type _objName = SWIG_NewPointerObj((void*) objName, SWIGTYPE_p__CMPIObjectPath, 0); + TARGET_THREAD_END_BLOCK; + Target_Type _assocClass = Target_Null; + Target_Type _resultClass = Target_Null; + Target_Type _role = Target_Null; + Target_Type _resultRole = Target_Null; + if (assocClass != NULL) + { + _assocClass = string2target(assocClass); + } + if (resultClass != NULL) + { + _resultClass = string2target(resultClass); + } + if (role != NULL) + { + _role = string2target(role); + } + if (resultRole != NULL) + { + _resultRole = string2target(resultRole); + } + + call_provider((ProviderMIHandle*)self->hdl, &status, "associator_names", 7, + _ctx, + _rslt, + _objName, + _assocClass, + _resultClass, + _role, + _resultRole); + + + _SBLIM_TRACE(1,("associatorNames() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + +/* + * associators + */ + +CMPIStatus +associators( + CMPIAssociationMI* self, + const CMPIContext* ctx, + const CMPIResult* rslt, + const CMPIObjectPath* objName, + const char* assocClass, + const char* resultClass, + const char* role, + const char* resultRole, + const char** properties) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; + + _SBLIM_TRACE(1,("associators() called, ctx %p, rslt %p, objName %p, assocClass %s, resultClass %s, role %s, resultRole %s", ctx, rslt, objName, assocClass, resultClass, role, resultRole)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0); + Target_Type _rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0); + Target_Type _objName = SWIG_NewPointerObj((void*) objName, SWIGTYPE_p__CMPIObjectPath, 0); + TARGET_THREAD_END_BLOCK; + Target_Type _props = proplist2target(properties); + Target_Type _assocClass = Target_Null; + Target_Type _resultClass = Target_Null; + Target_Type _role = Target_Null; + Target_Type _resultRole = Target_Null; + if (assocClass != NULL) + { + _assocClass = string2target(assocClass); + } + if (resultClass != NULL) + { + _resultClass = string2target(resultClass); + } + if (role != NULL) + { + _role = string2target(role); + } + if (resultRole != NULL) + { + _resultRole = string2target(resultRole); + } + + call_provider((ProviderMIHandle*)self->hdl, &status, "associators", 8, + _ctx, + _rslt, + _objName, + _assocClass, + _resultClass, + _role, + _resultRole, + _props); + + + _SBLIM_TRACE(1,("associators() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + +/* + * referenceNames + */ + +CMPIStatus +referenceNames( + CMPIAssociationMI* self, + const CMPIContext* ctx, + const CMPIResult* rslt, + const CMPIObjectPath* objName, + const char* resultClass, + const char* role) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; + + _SBLIM_TRACE(1,("referenceNames() called, ctx %p, rslt %p, objName %p, resultClass %s, role %s", ctx, rslt, objName, resultClass, role)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0); + Target_Type _rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0); + Target_Type _objName = SWIG_NewPointerObj((void*) objName, SWIGTYPE_p__CMPIObjectPath, 0); + TARGET_THREAD_END_BLOCK; + Target_Type _resultClass = Target_Null; + Target_Type _role = Target_Null; + if (role != NULL) + { + _role = string2target(role); + } + if (resultClass != NULL) + { + _resultClass = string2target(resultClass); + } + + call_provider((ProviderMIHandle*)self->hdl, &status, "reference_names", 5, + _ctx, + _rslt, + _objName, + _resultClass, + _role); + + + _SBLIM_TRACE(1,("referenceNames() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +/* + * references + */ + +CMPIStatus +references( + CMPIAssociationMI* self, + const CMPIContext* ctx, + const CMPIResult* rslt, + const CMPIObjectPath* objName, + const char* resultClass, + const char* role, + const char** properties) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; + + _SBLIM_TRACE(1,("references() called, ctx %p, rslt %p, objName %p, resultClass %s, role %s, properties %p", ctx, rslt, objName, resultClass, role, properties)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0); + Target_Type _rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0); + Target_Type _objName = SWIG_NewPointerObj((void*) objName, SWIGTYPE_p__CMPIObjectPath, 0); + TARGET_THREAD_END_BLOCK; + Target_Type _role = Target_Null; + Target_Type _resultClass = Target_Null; + if (role != NULL) + { + _role = string2target(role); + } + if (resultClass != NULL) + { + _resultClass = string2target(resultClass); + } + Target_Type _props = proplist2target(properties); + + call_provider((ProviderMIHandle*)self->hdl, &status, "references", 6, + _ctx, + _rslt, + _objName, + _resultClass, + _role, + _props); + + _SBLIM_TRACE(1,("references() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + +/* + * invokeMethod + */ +CMPIStatus +invokeMethod( + CMPIMethodMI* self, + const CMPIContext* ctx, + const CMPIResult* rslt, + const CMPIObjectPath* objName, + const char* method, + const CMPIArgs* in, + CMPIArgs* out) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; + + _SBLIM_TRACE(1,("invokeMethod() called, ctx %p, rslt %p, objName %p, method %s, in %p, out %p", ctx, rslt, objName, method, in, out)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0); + Target_Type _rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0); + Target_Type _objName = SWIG_NewPointerObj((void*) objName, SWIGTYPE_p__CMPIObjectPath, 0); + Target_Type _in = SWIG_NewPointerObj((void*) in, SWIGTYPE_p__CMPIArgs, 0); + Target_Type _out = SWIG_NewPointerObj((void*) out, SWIGTYPE_p__CMPIArgs, 0); + TARGET_THREAD_END_BLOCK; + Target_Type _method = string2target(method); + + call_provider((ProviderMIHandle*)self->hdl, &status, "invoke_method", 6, + _ctx, + _rslt, + _objName, + _method, + _in, + _out); + + _SBLIM_TRACE(1,("invokeMethod() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +/* + * authorizeFilter + */ + +CMPIStatus authorizeFilter( + CMPIIndicationMI* self, + const CMPIContext* ctx, + const CMPISelectExp* filter, + const char* className, + const CMPIObjectPath* classPath, + const char* owner) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; + + _SBLIM_TRACE(1,("authorizeFilter() called, ctx %p, filter %p, className %s, classPath %p, owner %s", ctx, filter, className, classPath, owner)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0); + Target_Type _filter = SWIG_NewPointerObj((void*) filter, SWIGTYPE_p__CMPISelectExp, 0); + Target_Type _classPath = SWIG_NewPointerObj((void*) classPath, SWIGTYPE_p__CMPIObjectPath, 0); + TARGET_THREAD_END_BLOCK; + Target_Type _className = string2target(className); + Target_Type _owner = string2target(owner); + + call_provider((ProviderMIHandle*)self->hdl, &status, "authorize_filter", 5, + _ctx, + _filter, + _className, + _classPath, + _owner); + + _SBLIM_TRACE(1,("authorizeFilter() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +/* + * activateFilter + */ + +CMPIStatus activateFilter( + CMPIIndicationMI* self, + const CMPIContext* ctx, + const CMPISelectExp* filter, + const char* className, + const CMPIObjectPath* classPath, + CMPIBoolean firstActivation) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; + + _SBLIM_TRACE(1,("activateFilter() called, ctx %p, filter %p, className %s, classPath %p, firstActivation %d", ctx, filter, className, classPath, firstActivation)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0); + Target_Type _filter = SWIG_NewPointerObj((void*) filter, SWIGTYPE_p__CMPISelectExp, 0); + Target_Type _classPath = SWIG_NewPointerObj((void*) classPath, SWIGTYPE_p__CMPIObjectPath, 0); + Target_Type _firstActivation = Target_Bool(firstActivation); + TARGET_THREAD_END_BLOCK; + Target_Type _className = string2target(className); + + call_provider((ProviderMIHandle*)self->hdl, &status, "activate_filter", 5, + _ctx, + _filter, + _className, + _classPath, + _firstActivation); + + _SBLIM_TRACE(1,("activateFilter() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +/* + * deActivateFilter + */ + +CMPIStatus deActivateFilter( + CMPIIndicationMI* self, + const CMPIContext* ctx, + const CMPISelectExp* filter, + const char* className, + const CMPIObjectPath* classPath, + CMPIBoolean lastActivation) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; + + _SBLIM_TRACE(1,("deActivateFilter() called, ctx %p, filter %p, className %s, classPath %p, lastActivation %d", ctx, filter, className, classPath, lastActivation)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0); + Target_Type _filter = SWIG_NewPointerObj((void*) filter, SWIGTYPE_p__CMPISelectExp, 0); + Target_Type _classPath = SWIG_NewPointerObj((void*) classPath, SWIGTYPE_p__CMPIObjectPath, 0); + Target_Type _lastActivation = Target_Bool(lastActivation); + TARGET_THREAD_END_BLOCK; + Target_Type _className = string2target(className); + + call_provider((ProviderMIHandle*)self->hdl, &status, "deactivate_filter", 5, + _ctx, + _filter, + _className, + _classPath, + _lastActivation); + + _SBLIM_TRACE(1,("deActivateFilter() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +/* + * mustPoll + * Note: sfcb doesn't support mustPoll. :( + * http://sourceforge.net/mailarchive/message.php?msg_id=OFF38FF3F9.39FD2E1F-ONC1257385.004A7122-C1257385.004BB0AF%40de.ibm.com + */ +CMPIStatus +mustPoll( + CMPIIndicationMI* self, + const CMPIContext* ctx, + //const CMPIResult* rslt, TODO: figure out who is right: spec. vs. sblim + const CMPISelectExp* filter, + const char* className, + const CMPIObjectPath* classPath) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; + + //_SBLIM_TRACE(1,("mustPoll() called, ctx %p, rslt %p, filter %p, className %s, classPath %p", ctx, rslt, filter, className, classPath)); + _SBLIM_TRACE(1,("mustPoll() called, ctx %p, filter %p, className %s, classPath %p", ctx, filter, className, classPath)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0); + //Target_Type _rslt = SWIG_NewPointerObj((void*) rslt, SWIGTYPE_p__CMPIResult, 0); + Target_Type _filter = SWIG_NewPointerObj((void*) filter, SWIGTYPE_p__CMPISelectExp, 0); + Target_Type _classPath = SWIG_NewPointerObj((void*) classPath, SWIGTYPE_p__CMPIObjectPath, 0); + TARGET_THREAD_END_BLOCK; + Target_Type _className = string2target(className); + + call_provider((ProviderMIHandle*)self->hdl, &status, "must_poll", 4, + _ctx, + //_rslt, + _filter, + _className, + _classPath); + + _SBLIM_TRACE(1,("mustPoll() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; +} + + +/* + * enableIndications + */ + +CMPIStatus +enableIndications( + CMPIIndicationMI* self, + const CMPIContext* ctx) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; + + _SBLIM_TRACE(1,("enableIndications() called, ctx %p", ctx)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0); + TARGET_THREAD_END_BLOCK; + + call_provider((ProviderMIHandle*)self->hdl, &status, "enable_indications", 1, _ctx); + + _SBLIM_TRACE(1,("enableIndications() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; + +} + + +/* + * disableIndications + */ + +CMPIStatus +disableIndications( + CMPIIndicationMI* self, + const CMPIContext* ctx) +{ + CMPIStatus status = {CMPI_RC_ERR_NOT_SUPPORTED, NULL}; + + _SBLIM_TRACE(1,("disableIndications() called, ctx %p", ctx)); + + TARGET_CMPI_INIT + + TARGET_THREAD_BEGIN_BLOCK; + Target_Type _ctx = SWIG_NewPointerObj((void*) ctx, SWIGTYPE_p__CMPIContext, 0); + TARGET_THREAD_END_BLOCK; + + call_provider((ProviderMIHandle*)self->hdl, &status, "disable_indications", 1, _ctx); + + _SBLIM_TRACE(1,("disableIndications() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + return status; + +} + + +/***************************************************************************/ + +/* MI function tables */ + +static CMPIMethodMIFT MethodMIFT__={ + CMPICurrentVersion, + CMPICurrentVersion, + "methodCmpi_Swig", // miName + MethodCleanup, + invokeMethod, +}; + + +static CMPIIndicationMIFT IndicationMIFT__={ + CMPICurrentVersion, + CMPICurrentVersion, + "indicationCmpi_Swig", // miName + IndicationCleanup, + authorizeFilter, + mustPoll, + activateFilter, + deActivateFilter, + enableIndications, + disableIndications, +}; + + +static CMPIAssociationMIFT AssociationMIFT__={ + CMPICurrentVersion, + CMPICurrentVersion, + "instanceCmpi_Swig", // miName + AssocCleanup, + associators, + associatorNames, + references, + referenceNames, +}; + + +static CMPIInstanceMIFT InstanceMIFT__={ + CMPICurrentVersion, + CMPICurrentVersion, + "associatorCmpi_Swig", // miName + InstCleanup, + EnumInstanceNames, + EnumInstances, + GetInstance, + CreateInstance, + SetInstance, + DeleteInstance, + ExecQuery, +}; + + +static void +createInit(const CMPIBroker* broker, + const CMPIContext* context, const char* miname, CMPIStatus* st) +{ + _SBLIM_TRACE(1,("\n>>>>> createInit() called, miname= %s (ctx=%p)\n", miname, context)); + + /* + * We can't initialize the target here and load target modules, because + * SFCB passes a NULL CMPIStatus* st, which means we can't report + * back error strings. Instead, we'll check and initialize in each + * MIFT function + */ +} + + +#define SWIG_CMPI_MI_FACTORY(ptype) \ +CMPI##ptype##MI* _Generic_Create_##ptype##MI(const CMPIBroker* broker, \ + const CMPIContext* context, const char* miname, CMPIStatus* st)\ +{ \ + _SBLIM_TRACE(1, ("\n>>>>> in FACTORY: CMPI"#ptype"MI* _Generic_Create_"#ptype"MI... miname=%s", miname)); \ + ProviderMIHandle *hdl = (ProviderMIHandle*)malloc(sizeof(ProviderMIHandle)); \ + if (hdl) { \ + hdl->tgMod = Target_Null; \ + hdl->miName = strdup(miname); \ + hdl->broker = broker; \ + } \ + CMPI##ptype##MI *mi= (CMPI##ptype##MI*)malloc(sizeof(CMPI##ptype##MI)); \ + if (mi) { \ + mi->hdl = hdl; \ + mi->ft = &ptype##MIFT__; \ + } \ + createInit(broker, context, miname, st); \ + /*_SBLIM_TRACE(1, ("\n>>>>> returning mi=0x%08x mi->hdl=0x%08x mi->ft=0x%08x", mi, mi->hdl, mi->ft));*/ \ + ++_MI_COUNT; \ + return mi; \ +} + +SWIG_CMPI_MI_FACTORY(Instance) +SWIG_CMPI_MI_FACTORY(Method) +SWIG_CMPI_MI_FACTORY(Association) +SWIG_CMPI_MI_FACTORY(Indication) + +#undef _CMPI_SETFAIL +#undef TARGET_THREAD_BEGIN_BLOCK +#undef TARGET_THREAD_END_BLOCK +#undef TARGET_THREAD_BEGIN_ALLOW +#undef TARGET_THREAD_END_ALLOW Property changes on: cmpi-bindings/trunk/src/cmpi_provider.c ___________________________________________________________________ Added: svn:mergeinfo + Deleted: cmpi-bindings/trunk/src/cmpi_provider_python.c =================================================================== --- cmpi-bindings/trunk/src/cmpi_provider_python.c 2008-09-29 17:19:29 UTC (rev 1051) +++ cmpi-bindings/trunk/src/cmpi_provider_python.c 2008-09-29 20:57:08 UTC (rev 1052) @@ -1,1478 +0,0 @@ -/***************************************************************************** -* Copyright (C) 2008 Novell Inc. All rights reserved. -* Copyright (C) 2008 SUSE Linux Products GmbH. 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 of SUSE Linux Products GmbH 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 SUSE Linux Products GmbH 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. -*****************************************************************************/ - -#include <stdio.h> -#include <stdarg.h> -#include <pthread.h> - -/* Include the required CMPI macros, data types, and API function headers */ -#include <cmpidt.h> -#include <cmpift.h> -#include <cmpimacs.h> - -// Needed to obtain errno of failed system calls -#include <errno.h> - -/* Needed for kill() */ -#include <signal.h> - -/* A simple stderr logging/tracing facility. */ -#ifndef _SBLIM_TRACE -#define _SBLIM_TRACE(tracelevel,args) _logstderr args -void _logstderr(char *fmt,...) -{ - va_list ap; - va_start(ap,fmt); - vfprintf(stderr,fmt,ap); - va_end(ap); - fprintf(stderr,"\n"); -} -#endif - - -SWIGEXPORT void SWIG_init(void); -#define _CMPI_SETFAIL(msgstr) {if (st != NULL) st->rc = CMPI_RC_ERR_FAILED; st->msg = msgstr; } - - -/* -**============================================================================== -** -** Local definitions: -** -**============================================================================== -*/ - -static char* fmtstr(const char* fmt, ...) -{ - va_list ap; - int len; - va_start(ap, fmt); - len = vsnprintf(NULL, 0, fmt, ap); - va_end(ap); - if (len <= 0) - { - return NULL; - } - char* str = (char*)malloc(len+1); - if (str == NULL) - { - return NULL; - } - va_start(ap, fmt); - vsnprintf(str, len+1, fmt, ap); - va_end(ap); - return str; -} - - -/* -**============================================================================== -** Python -**============================================================================== -*/ - -/* -**============================================================================== -** -** Local definitions: -** -**============================================================================== -*/ - -#include <Python.h> - - -static pthread_mutex_t _CMPI_INIT_MUTEX = PTHREAD_MUTEX_INITIALIZER; -static int _PY_INIT = 0; // acts as a boolean - is Python Initialized -static int _MI_COUNT = 0; -static PyThreadState* cmpiMainPyThreadState = NULL; -static PyObject* _PYPROVMOD = NULL; - -/* - * per-MI struct to keep - * - name of MI - * - pointer to (Python) instrumentation - * - pointer to Broker - */ - -typedef struct __PyProviderMIHandle -{ - char *miName; - PyObject *pyMod; - const CMPIBroker* broker; -} PyProviderMIHandle; - -/* - * string2py - * char* -> PyString - */ - -static PyObject * -string2py(const char *s) -{ - if (s == NULL) - return NULL; - - PyObject *obj; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - - obj = PyString_FromString(s); - SWIG_PYTHON_THREAD_END_BLOCK; - - return obj; -} - - -/* - * proplist2py - * char** -> PyList - */ - -static PyObject* -proplist2py(const char** cplist) -{ - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (cplist == NULL) - { - Py_INCREF(Py_None); - SWIG_PYTHON_THREAD_END_BLOCK; - return Py_None; - } - PyObject* pl; - - pl = PyList_New(0); - for (; (cplist!=NULL && *cplist != NULL); ++cplist) - { - PyList_Append(pl, PyString_FromString(*cplist)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - - return pl; -} - - -/* - * print Python exception trace - * - */ - -#define TB_ERROR(str) {tbstr = str; goto cleanup;} -static CMPIString* -get_exc_trace(const CMPIBroker* broker) -{ - char *tbstr = NULL; - - PyObject *iostrmod = NULL; - PyObject *tbmod = NULL; - PyObject *iostr = NULL; - PyObject *obstr = NULL; - PyObject *args = NULL; - PyObject *newstr = NULL; - PyObject *func = NULL; - CMPIString* rv = NULL; - - PyObject *type, *value, *traceback; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_Fetch(&type, &value, &traceback); - _SBLIM_TRACE(1,("** type %p, value %p, traceback %p", type, value, traceback)); - PyErr_Print(); - PyErr_Clear(); - PyErr_NormalizeException(&type, &value, &traceback); - _SBLIM_TRACE(1,("** type %p, value %p, traceback %p", type, value, traceback)); - - iostrmod = PyImport_ImportModule("StringIO"); - if (iostrmod==NULL) - TB_ERROR("can't import StringIO"); - - iostr = PyObject_CallMethod(iostrmod, "StringIO", NULL); - - if (iostr==NULL) - TB_ERROR("cStringIO.StringIO() failed"); - - tbmod = PyImport_ImportModule("traceback"); - if (tbmod==NULL) - TB_ERROR("can't import traceback"); - - obstr = PyObject_CallMethod(tbmod, "print_exception", - "(OOOOO)", - type ? type : Py_None, - value ? value : Py_None, - traceback ? traceback : Py_None, - Py_None, - iostr); - - if (obstr==NULL) - { - PyErr_Print(); - TB_ERROR("traceback.print_exception() failed"); - } - - Py_DecRef(obstr); - - obstr = PyObject_CallMethod(iostr, "getvalue", NULL); - if (obstr==NULL) - TB_ERROR("getvalue() failed."); - - if (!PyString_Check(obstr)) - TB_ERROR("getvalue() did not return a string"); - - _SBLIM_TRACE(1,("%s", PyString_AsString(obstr))); - args = PyTuple_New(2); - PyTuple_SetItem(args, 0, string2py("\n")); - PyTuple_SetItem(args, 1, string2py("<br>")); - - func = PyObject_GetAttrString(obstr, "replace"); - //newstr = PyObject_CallMethod(obstr, "replace", args); - newstr = PyObject_CallObject(func, args); - - tbstr = PyString_AsString(newstr); - - char* tmp = fmtstr("cmpi:%s", tbstr); - rv = broker->eft->newString(broker, tmp, NULL); - free(tmp); - -cleanup: - PyErr_Restore(type, value, traceback); - - if (rv == NULL) - { - rv = broker->eft->newString(broker, tbstr ? tbstr : "", NULL); - } - - Py_DecRef(func); - Py_DecRef(args); - Py_DecRef(newstr); - Py_DecRef(iostr); - Py_DecRef(obstr); - Py_DecRef(iostrmod); - Py_DecRef(tbmod); - - - SWIG_PYTHON_THREAD_END_BLOCK; - return rv; -} - - -/* - * Global Python initializer - * loads the Python interpreter - * init threads - */ - -static int -PyGlobalInitialize(const CMPIBroker* broker, CMPIStatus* st) -{ - _SBLIM_TRACE(1,("<%d/0x%x> PyGlobalInitialize() called", getpid(), pthread_self())); - - if (_PY_INIT) - { - _SBLIM_TRACE(1,("<%d/0x%x> PyGlobalInitialize() returning: already initialized", getpid(), pthread_self())); - return 0; - } - _PY_INIT=1;//true - - _SBLIM_TRACE(1,("<%d/0x%x> Python: Loading", getpid(), pthread_self())); - - Py_SetProgramName("cmpi_swig"); - Py_Initialize(); - SWIG_init(); - cmpiMainPyThreadState = PyGILState_GetThisThreadState(); - PyEval_ReleaseThread(cmpiMainPyThreadState); - - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - _PYPROVMOD = PyImport_ImportModule("cmpi_pywbem_bindings"); - if (_PYPROVMOD == NULL) - { - SWIG_PYTHON_THREAD_END_BLOCK; - _SBLIM_TRACE(1,("<%d/0x%x> Python: import cmpi_pywbem_bindings failed", getpid(), pthread_self())); - CMPIString* trace = get_exc_trace(broker); - _SBLIM_TRACE(1,("<%d/0x%x> %s", getpid(), pthread_self(), - CMGetCharsPtr(trace, NULL))); - _CMPI_SETFAIL(trace); - abort(); - return -1; - } - _SBLIM_TRACE(1,("<%d/0x%x> Python: _PYPROVMOD at %p", getpid(), pthread_self(), _PYPROVMOD)); - - SWIG_PYTHON_THREAD_END_BLOCK; - _SBLIM_TRACE(1,("<%d/0x%x> PyGlobalInitialize() succeeded", getpid(), pthread_self())); - return 0; -} - - -/* - * local (per MI) Python initializer - * keeps track of reference count - */ - -static int -PyInitialize(PyProviderMIHandle* hdl, CMPIStatus* st) -{ - int rc = 0; - /* Set _CMPI_INIT, protected by _CMPI_INIT_MUTEX - * so we call Py_Finalize() only once. - */ - if (pthread_mutex_lock(&_CMPI_INIT_MUTEX)) - { - perror("Can't lock _CMPI_INIT_MUTEX"); - abort(); - } - rc = PyGlobalInitialize(hdl->broker, st); - pthread_mutex_unlock(&_CMPI_INIT_MUTEX); - if (rc != 0) - { - return rc; - } - - _SBLIM_TRACE(1,("<%d/0x%x> PyInitialize() called", getpid(), pthread_self())); - - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyObject* provclass = PyObject_GetAttrString(_PYPROVMOD, - "get_cmpi_proxy_provider"); - if (provclass == NULL) - { - SWIG_PYTHON_THREAD_END_BLOCK; - _CMPI_SETFAIL(get_exc_trace(hdl->broker)); - return -1; - } - PyObject* broker = SWIG_NewPointerObj((void*) hdl->broker, SWIGTYPE_p__CMPIBroker, 0); - PyObject* args = PyTuple_New(2); - _SBLIM_TRACE(1,("\n<%d/0x%x> >>>>> PyInitialize(Python) called, MINAME=%s\n", - getpid(), pthread_self(), hdl->miName)); - PyTuple_SetItem(args, 0, string2py(hdl->miName)); - PyTuple_SetItem(args, 1, broker); - PyObject* provinst = PyObject_CallObject(provclass, args); - Py_DecRef(args); - Py_DecRef(provclass); - if (provinst == NULL) - { - SWIG_PYTHON_THREAD_END_BLOCK; - _CMPI_SETFAIL(get_exc_trace(hdl->broker)); - return -1; - } - - hdl->pyMod = provinst; - - SWIG_PYTHON_THREAD_END_BLOCK; - _SBLIM_TRACE(1,("<%d/0x%x> PyInitialize() succeeded", getpid(), pthread_self())); - return 0; -} - -/* on-demand init */ -#define PY_CMPI_INIT { if (((PyProviderMIHandle*)(self->hdl))->pyMod == NULL) if (PyInitialize(((PyProviderMIHandle*)(self->hdl)), &status) != 0) return status; } - - -/* - * call_py_provider - * - */ - -static int -call_py_provider(PyProviderMIHandle* hdl, CMPIStatus* st, - const char* opname, int nargs, ...) -{ - int rc = 1; - va_list vargs; - PyObject *pyargs = NULL; - PyObject *pyfunc = NULL; - PyObject *prv = NULL; - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - - pyargs = PyTuple_New(nargs); - pyfunc = PyObject_GetAttrString(hdl->pyMod, opname); - if (pyfunc == NULL) - { - PyErr_Print(); - PyErr_Clear(); - char* str = fmtstr("Python module does not contain \"%s\"", opname); - _SBLIM_TRACE(1,("%s", str)); - st->rc = CMPI_RC_ERR_FAILED; - st->msg = hdl->broker->eft->newString(hdl->broker, str, NULL); - free(str); - rc = 1; - goto cleanup; - } - if (! PyCallable_Check(pyfunc)) - { - char* str = fmtstr("Python module attribute \"%s\" is not callable", - opname); - _SBLIM_TRACE(1,("%s", str)); - st->rc = CMPI_RC_ERR_FAILED; - st->msg = hdl->broker->eft->newString(hdl->broker, str, NULL); - free(str); - rc = 1; - goto cleanup; - } - - va_start(vargs, nargs); - int i; - for (i = 0; i < nargs; ++i) - { - PyObject* arg = va_arg(vargs, PyObject*); - if (arg == NULL) - { - arg = Py_None; - Py_IncRef(arg); - } - PyTuple_SET_ITEM(pyargs, i, arg); - } - va_end(vargs); - prv = PyObject_CallObject(pyfunc, pyargs); - if (PyErr_Occurred()) - { - st->rc = CMPI_RC_ERR_FAILED; - st->msg = get_exc_trace(hdl->broker); - PyErr_Clear(); - rc = 1; - goto cleanup; - } - - if (! PyTuple_Check(prv) || - (PyTuple_Size(prv) != 2 && PyTuple_Size(prv) != 1)) - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - char* str = fmtstr("Python function \"%s\" didn't return a two-tuple", - opname); - _SBLIM_TRACE(1,("%s", str)); - st->rc = CMPI_RC_ERR_FAILED; - st->msg = hdl->broker->eft->newString(hdl->broker, str, NULL); - free(str); - rc = 1; - SWIG_PYTHON_THREAD_END_ALLOW; - goto cleanup; - } - PyObject* prc = PyTuple_GetItem(prv, 0); - PyObject* prstr = Py_None; - if (PyTuple_Size(prv) == 2) - { - prstr = PyTuple_GetItem(prv, 1); - } - - if (! PyInt_Check(prc) || (! PyString_Check(prstr) && prstr != Py_None)) - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - char* str = fmtstr("Python function \"%s\" didn't return a {<int>, <str>) two-tuple", opname); - _SBLIM_TRACE(1,("%s", str)); - st->rc = CMPI_RC_ERR_FAILED; - st->msg = hdl->broker->eft->newString(hdl->broker, str, NULL); - free(str); - rc = 1; - SWIG_PYTHON_THREAD_END_ALLOW; - goto cleanup; - } - long pi = PyInt_AsLong(prc); - st->rc = (CMPIrc)pi; - if (prstr == Py_None) - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - st->msg = hdl->broker->eft->newString(hdl->broker, "", NULL); - SWIG_PYTHON_THREAD_END_ALLOW; - } - else - { - st->msg = hdl->broker->eft->newString(hdl->broker, - PyString_AsString(prstr), NULL); - } - rc = pi != 0; -cleanup: - Py_DecRef(pyargs); - Py_DecRef(pyfunc); - Py_DecRef(prv); - SWIG_PYTHON_THREAD_END_BLOCK; - - return rc; -} - - -/* - * Cleanup - * - */ - -static CMPIStatus Cleanup( - PyProviderMIHandle * miHdl, - const CMPIContext * context, - CMPIBoolean terminating) -{ - CMPIStatus status = {CMPI_RC_OK, NULL}; /* Return status of CIM operations. */ - - if (miHdl != NULL) - { - free(miHdl->miName); - - // we must free the miHdl - it is our PyProviderMIHandle. - // it is pointed to by the CMPI<type>MI * that the broker holds onto... - // the broker is responsible for freeing the CMPI<type>MI* - free(miHdl); - miHdl = NULL; - } - - /* Decrement _MI_COUNT, protected by _CMPI_INIT_MUTEX - * call Py_Finalize when _MI_COUNT drops to zero - */ - if (pthread_mutex_lock(&_CMPI_INIT_MUTEX)) - { - perror("Can't lock _CMPI_INIT_MUTEX"); - abort(); - } - if (--_MI_COUNT > 0) - { - pthread_mutex_unlock(&_CMPI_INIT_MUTEX); - return status; - } - - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - Py_DecRef(_PYPROVMOD); - SWIG_PYTHON_THREAD_END_BLOCK; - - PyEval_AcquireLock(); - PyThreadState_Swap(cmpiMainPyThreadState); - if (_PY_INIT) // if PY is initialized and _MI_COUNT == 0, call Py_Finalize - { - _SBLIM_TRACE(1,("Calling Py_Finalize()")); - Py_Finalize(); - _PY_INIT=0; // false - } - pthread_mutex_unlock(&_CMPI_INIT_MUTEX); - - _SBLIM_TRACE(1,("Cleanup() %s", (status.rc == CMPI_RC_OK)? "succeeded":"failed")); - return status; -} - - -/* -**============================================================================== -** -** Provider Interface functions -** -**============================================================================== -*/ - -/* - * InstCleanup - */ - -static CMPIStatus -InstCleanup(CMPIInstanceMI * self, - const CMPIContext * context, - CMPIBoolean terminating) -{ - _SBLIM_TRACE(1,("Cleanup(Python) called for Instance provider %s", ((PyProviderMIHandle *)self->hdl)->miName)); - CMPIStatus st = Cleanup((PyProviderMIHandle*)self->hdl, context, terminating); - return st; -} - - -/* - * AssocCleanup - */ - -static CMPIStatus -AssocCleanup(CMPIAssociationMI * self, - const CMPIContext * context, - CMPIBoolean terminating) -{ - _SBLIM_TRACE(1,("Cleanup(Python) called for Association provider %s", ((PyProviderMIHandle *)self->hdl)->miName)); - CMPIStatus st = Cleanup((PyProviderMIHandle*)self->hdl, context, terminating); - return st; -} - - -/* - * MethodCleanup - */ - -static CMPIStatus -MethodCleanup(CMPIMethodMI * self, - const CMPIContext * context, - CMPIBoolean terminating) -{ - _SBLIM_TRACE(1,("Cleanup(Python) called for Method provider %s", ((PyProviderMIHandle *)self->hdl)->miName)); - CMPIStatus st = Cleanup((PyProviderMIHandle*)self->hdl, context, terminating); - return st; -} - - -/* - * IndicationCleanup - */ - -static CMPIStatus -IndicationCleanup(CMPIIndicationMI * self, - const CMPIContext * context, - CMPIBoolean terminating) -{ - _SBLIM_TRACE(1,("Cleanup(Python) called for ... [truncated message content] |
From: <ba...@us...> - 2008-09-29 17:19:39
|
Revision: 1051 http://omc.svn.sourceforge.net/omc/?rev=1051&view=rev Author: bartw Date: 2008-09-29 17:19:29 +0000 (Mon, 29 Sep 2008) Log Message: ----------- added description and caption properties to initdservices. Modified Paths: -------------- pybase/trunk/OMC_InitdService.py Modified: pybase/trunk/OMC_InitdService.py =================================================================== --- pybase/trunk/OMC_InitdService.py 2008-09-29 14:19:11 UTC (rev 1050) +++ pybase/trunk/OMC_InitdService.py 2008-09-29 17:19:29 UTC (rev 1051) @@ -99,8 +99,6 @@ logger.log_debug('Entering %s.get_instance() for %s' \ % (self.__class__.__name__, model['name'])) - #model['Caption'] = # TODO (type = unicode) - #model['Description'] = # TODO (type = unicode) #model['ElementName'] = # TODO (type = unicode) #model['EnabledDefault'] = # TODO (type = pywbem.Uint16 self.Values.EnabledDefault) (default=2L) #model['EnabledState'] = # TODO (type = pywbem.Uint16 self.Values.EnabledState) (default=5L) @@ -110,6 +108,17 @@ if not filtered and (_blacklist(model['name']) or not os.path.isfile(fullpath)): raise pywbem.CIMError(CIM_ERR_NOT_FOUND) + + fo = open(fullpath, 'r') + caption = None + for line in fo.xreadlines(): + if line.startswith('#') and 'Short-Description:' in line: + caption = line[line.find(':')+1:] + break + if caption: + model['Caption'] = caption + model['Description'] = caption + osts = [] cmd = fullpath + ' status' st = call(cmd, shell=True) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2008-09-29 14:19:18
|
Revision: 1050 http://omc.svn.sourceforge.net/omc/?rev=1050&view=rev Author: kkaempf Date: 2008-09-29 14:19:11 +0000 (Mon, 29 Sep 2008) Log Message: ----------- separate Python-specific from generic code better Modified Paths: -------------- cmpi-bindings/trunk/src/cmpi_provider_python.c Modified: cmpi-bindings/trunk/src/cmpi_provider_python.c =================================================================== --- cmpi-bindings/trunk/src/cmpi_provider_python.c 2008-09-29 13:38:37 UTC (rev 1049) +++ cmpi-bindings/trunk/src/cmpi_provider_python.c 2008-09-29 14:19:11 UTC (rev 1050) @@ -44,8 +44,6 @@ /* Needed for kill() */ #include <signal.h> -#include <Python.h> - /* A simple stderr logging/tracing facility. */ #ifndef _SBLIM_TRACE #define _SBLIM_TRACE(tracelevel,args) _logstderr args @@ -59,6 +57,11 @@ } #endif + +SWIGEXPORT void SWIG_init(void); +#define _CMPI_SETFAIL(msgstr) {if (st != NULL) st->rc = CMPI_RC_ERR_FAILED; st->msg = msgstr; } + + /* **============================================================================== ** @@ -67,20 +70,6 @@ **============================================================================== */ -static pthread_mutex_t _CMPI_INIT_MUTEX = PTHREAD_MUTEX_INITIALIZER; -static int _PY_INIT = 0; // acts as a boolean - is Python Initialized -static int _MI_COUNT = 0; -static PyThreadState* cmpiMainPyThreadState = NULL; -static PyObject* _PYPROVMOD = NULL; - - -typedef struct __PyProviderMIHandle -{ - char *miName; - PyObject *pyMod; - const CMPIBroker* broker; -} PyProviderMIHandle; - static char* fmtstr(const char* fmt, ...) { va_list ap; @@ -104,6 +93,48 @@ } +/* +**============================================================================== +** Python +**============================================================================== +*/ + +/* +**============================================================================== +** +** Local definitions: +** +**============================================================================== +*/ + +#include <Python.h> + + +static pthread_mutex_t _CMPI_INIT_MUTEX = PTHREAD_MUTEX_INITIALIZER; +static int _PY_INIT = 0; // acts as a boolean - is Python Initialized +static int _MI_COUNT = 0; +static PyThreadState* cmpiMainPyThreadState = NULL; +static PyObject* _PYPROVMOD = NULL; + +/* + * per-MI struct to keep + * - name of MI + * - pointer to (Python) instrumentation + * - pointer to Broker + */ + +typedef struct __PyProviderMIHandle +{ + char *miName; + PyObject *pyMod; + const CMPIBroker* broker; +} PyProviderMIHandle; + +/* + * string2py + * char* -> PyString + */ + static PyObject * string2py(const char *s) { @@ -120,7 +151,39 @@ } +/* + * proplist2py + * char** -> PyList + */ +static PyObject* +proplist2py(const char** cplist) +{ + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + if (cplist == NULL) + { + Py_INCREF(Py_None); + SWIG_PYTHON_THREAD_END_BLOCK; + return Py_None; + } + PyObject* pl; + + pl = PyList_New(0); + for (; (cplist!=NULL && *cplist != NULL); ++cplist) + { + PyList_Append(pl, PyString_FromString(*cplist)); + } + SWIG_PYTHON_THREAD_END_BLOCK; + + return pl; +} + + +/* + * print Python exception trace + * + */ + #define TB_ERROR(str) {tbstr = str; goto cleanup;} static CMPIString* get_exc_trace(const CMPIBroker* broker) @@ -218,9 +281,14 @@ } -SWIGEXPORT void SWIG_init(void); -#define PY_CMPI_SETFAIL(msgstr) {if (st != NULL) st->rc = CMPI_RC_ERR_FAILED; st->msg = msgstr; } -static int PyGlobalInitialize(const CMPIBroker* broker, CMPIStatus* st) +/* + * Global Python initializer + * loads the Python interpreter + * init threads + */ + +static int +PyGlobalInitialize(const CMPIBroker* broker, CMPIStatus* st) { _SBLIM_TRACE(1,("<%d/0x%x> PyGlobalInitialize() called", getpid(), pthread_self())); @@ -248,7 +316,7 @@ CMPIString* trace = get_exc_trace(broker); _SBLIM_TRACE(1,("<%d/0x%x> %s", getpid(), pthread_self(), CMGetCharsPtr(trace, NULL))); - PY_CMPI_SETFAIL(trace); + _CMPI_SETFAIL(trace); abort(); return -1; } @@ -260,7 +328,13 @@ } -static int PyInitialize(PyProviderMIHandle* hdl, CMPIStatus* st) +/* + * local (per MI) Python initializer + * keeps track of reference count + */ + +static int +PyInitialize(PyProviderMIHandle* hdl, CMPIStatus* st) { int rc = 0; /* Set _CMPI_INIT, protected by _CMPI_INIT_MUTEX @@ -286,7 +360,7 @@ if (provclass == NULL) { SWIG_PYTHON_THREAD_END_BLOCK; - PY_CMPI_SETFAIL(get_exc_trace(hdl->broker)); + _CMPI_SETFAIL(get_exc_trace(hdl->broker)); return -1; } PyObject* broker = SWIG_NewPointerObj((void*) hdl->broker, SWIGTYPE_p__CMPIBroker, 0); @@ -301,7 +375,7 @@ if (provinst == NULL) { SWIG_PYTHON_THREAD_END_BLOCK; - PY_CMPI_SETFAIL(get_exc_trace(hdl->broker)); + _CMPI_SETFAIL(get_exc_trace(hdl->broker)); return -1; } @@ -312,31 +386,14 @@ return 0; } - +/* on-demand init */ #define PY_CMPI_INIT { if (((PyProviderMIHandle*)(self->hdl))->pyMod == NULL) if (PyInitialize(((PyProviderMIHandle*)(self->hdl)), &status) != 0) return status; } -static PyObject* -proplist2py(const char** cplist) -{ - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - if (cplist == NULL) - { - Py_INCREF(Py_None); - SWIG_PYTHON_THREAD_END_BLOCK; - return Py_None; - } - PyObject* pl; - - pl = PyList_New(0); - for (; (cplist!=NULL && *cplist != NULL); ++cplist) - { - PyList_Append(pl, PyString_FromString(*cplist)); - } - SWIG_PYTHON_THREAD_END_BLOCK; - - return pl; -} +/* + * call_py_provider + * + */ static int call_py_provider(PyProviderMIHandle* hdl, CMPIStatus* st, @@ -455,6 +512,10 @@ } +/* + * Cleanup + * + */ static CMPIStatus Cleanup( PyProviderMIHandle * miHdl, @@ -515,8 +576,12 @@ **============================================================================== */ -static CMPIStatus InstCleanup( - CMPIInstanceMI * self, +/* + * InstCleanup + */ + +static CMPIStatus +InstCleanup(CMPIInstanceMI * self, const CMPIContext * context, CMPIBoolean terminating) { @@ -525,8 +590,13 @@ return st; } -static CMPIStatus AssocCleanup( - CMPIAssociationMI * self, + +/* + * AssocCleanup + */ + +static CMPIStatus +AssocCleanup(CMPIAssociationMI * self, const CMPIContext * context, CMPIBoolean terminating) { @@ -535,8 +605,13 @@ return st; } -static CMPIStatus MethodCleanup( - CMPIMethodMI * self, + +/* + * MethodCleanup + */ + +static CMPIStatus +MethodCleanup(CMPIMethodMI * self, const CMPIContext * context, CMPIBoolean terminating) { @@ -545,8 +620,13 @@ return st; } -static CMPIStatus IndicationCleanup( - CMPIIndicationMI * self, + +/* + * IndicationCleanup + */ + +static CMPIStatus +IndicationCleanup(CMPIIndicationMI * self, const CMPIContext * context, CMPIBoolean terminating) { @@ -558,9 +638,11 @@ // ---------------------------------------------------------------------------- -/* EnumInstanceNames() - return a list of all the instances names (i.e. return their object paths only) */ -static CMPIStatus EnumInstanceNames( - CMPIInstanceMI * self, +/* + * EnumInstanceNames() - return a list of all the instances names (i.e. return their object paths only) + */ +static CMPIStatus +EnumInstanceNames(CMPIInstanceMI * self, const CMPIContext * context, const CMPIResult * result, const CMPIObjectPath * reference) @@ -591,9 +673,11 @@ // ---------------------------------------------------------------------------- -/* EnumInstances() - return a list of all the instances (i.e. return all the instance data) */ -static CMPIStatus EnumInstances( - CMPIInstanceMI * self, +/* + * EnumInstances() - return a list of all the instances (i.e. return all the instance data) + */ +static CMPIStatus +EnumInstances(CMPIInstanceMI * self, const CMPIContext * context, const CMPIResult * result, const CMPIObjectPath * reference, @@ -627,9 +711,11 @@ // ---------------------------------------------------------------------------- -/* GetInstance() - return the instance data for the specified instance only */ -static CMPIStatus GetInstance( - CMPIInstanceMI * self, +/* + * GetInstance() - return the instance data for the specified instance only + */ +static CMPIStatus +GetInstance(CMPIInstanceMI * self, const CMPIContext * context, const CMPIResult * results, const CMPIObjectPath * reference, @@ -662,9 +748,11 @@ // ---------------------------------------------------------------------------- -/* CreateInstance() - create a new instance from the specified instance data. */ -static CMPIStatus CreateInstance( - CMPIInstanceMI * self, +/* + * CreateInstance() - create a new instance from the specified instance data. + */ +static CMPIStatus +CreateInstance(CMPIInstanceMI * self, const CMPIContext * context, const CMPIResult * results, const CMPIObjectPath * reference, @@ -702,9 +790,11 @@ #define SetInstance ModifyInstance #endif -/* SetInstance() - save modified instance data for the specified instance. */ -static CMPIStatus SetInstance( - CMPIInstanceMI * self, +/* + * SetInstance() - save modified instance data for the specified instance. + */ +static CMPIStatus +SetInstance(CMPIInstanceMI * self, const CMPIContext * context, const CMPIResult * results, const CMPIObjectPath * reference, @@ -738,12 +828,14 @@ return status; } -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- */ -/* DeleteInstance() - delete/remove the specified instance. */ -static CMPIStatus DeleteInstance( - CMPIInstanceMI * self, +/* + * DeleteInstance() - delete/remove the specified instance. + */ +static CMPIStatus +DeleteInstance(CMPIInstanceMI * self, const CMPIContext * context, const CMPIResult * results, const CMPIObjectPath * reference) @@ -769,12 +861,14 @@ return status; } -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- */ -/* ExecQuery() - return a list of all the instances that satisfy the desired query filter. */ -static CMPIStatus ExecQuery( - CMPIInstanceMI * self, +/* + * ExecQuery() - return a list of all the instances that satisfy the desired query filter. + */ +static CMPIStatus +ExecQuery(CMPIInstanceMI * self, const CMPIContext * context, const CMPIResult * results, const CMPIObjectPath * reference, @@ -809,12 +903,16 @@ } -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * CMPI external API + * ---------------------------------------------------------------------------- */ -// associatorMIFT -// +/* + * associatorMIFT + */ -CMPIStatus associatorNames( +CMPIStatus +associatorNames( CMPIAssociationMI* self, const CMPIContext* ctx, const CMPIResult* rslt, @@ -870,8 +968,12 @@ return status; } -/***************************************************************************/ -CMPIStatus associators( +/* + * associators + */ + +CMPIStatus +associators( CMPIAssociationMI* self, const CMPIContext* ctx, const CMPIResult* rslt, @@ -930,8 +1032,12 @@ return status; } -/***************************************************************************/ -CMPIStatus referenceNames( +/* + * referenceNames + */ + +CMPIStatus +referenceNames( CMPIAssociationMI* self, const CMPIContext* ctx, const CMPIResult* rslt, @@ -974,8 +1080,12 @@ } -/***************************************************************************/ -CMPIStatus references( +/* + * references + */ + +CMPIStatus +references( CMPIAssociationMI* self, const CMPIContext* ctx, const CMPIResult* rslt, @@ -1019,8 +1129,11 @@ return status; } -/***************************************************************************/ -CMPIStatus invokeMethod( +/* + * invokeMethod + */ +CMPIStatus +invokeMethod( CMPIMethodMI* self, const CMPIContext* ctx, const CMPIResult* rslt, @@ -1056,7 +1169,11 @@ return status; } -/***************************************************************************/ + +/* + * authorizeFilter + */ + CMPIStatus authorizeFilter( CMPIIndicationMI* self, const CMPIContext* ctx, @@ -1090,7 +1207,11 @@ return status; } -/***************************************************************************/ + +/* + * activateFilter + */ + CMPIStatus activateFilter( CMPIIndicationMI* self, const CMPIContext* ctx, @@ -1124,7 +1245,11 @@ return status; } -/***************************************************************************/ + +/* + * deActivateFilter + */ + CMPIStatus deActivateFilter( CMPIIndicationMI* self, const CMPIContext* ctx, @@ -1159,10 +1284,13 @@ } -/***************************************************************************/ -// Note: sfcb doesn't support mustPoll. :( -// http://sourceforge.net/mailarchive/message.php?msg_id=OFF38FF3F9.39FD2E1F-ONC1257385.004A7122-C1257385.004BB0AF%40de.ibm.com -CMPIStatus mustPoll( +/* + * mustPoll + * Note: sfcb doesn't support mustPoll. :( + * http://sourceforge.net/mailarchive/message.php?msg_id=OFF38FF3F9.39FD2E1F-ONC1257385.004A7122-C1257385.004BB0AF%40de.ibm.com + */ +CMPIStatus +mustPoll( CMPIIndicationMI* self, const CMPIContext* ctx, //const CMPIResult* rslt, TODO: figure out who is right: spec. vs. sblim @@ -1197,8 +1325,12 @@ } -/***************************************************************************/ -CMPIStatus enableIndications( +/* + * enableIndications + */ + +CMPIStatus +enableIndications( CMPIIndicationMI* self, const CMPIContext* ctx) { @@ -1219,8 +1351,13 @@ } -/***************************************************************************/ -CMPIStatus disableIndications( + +/* + * disableIndications + */ + +CMPIStatus +disableIndications( CMPIIndicationMI* self, const CMPIContext* ctx) { @@ -1244,6 +1381,7 @@ /***************************************************************************/ +/* MI function tables */ static CMPIMethodMIFT MethodMIFT__={ CMPICurrentVersion, @@ -1294,7 +1432,9 @@ ExecQuery, }; -static void createInit(const CMPIBroker* broker, + +static void +createInit(const CMPIBroker* broker, const CMPIContext* context, const char* miname, CMPIStatus* st) { _SBLIM_TRACE(1,("\n>>>>> createInit(Python) called, miname= %s (ctx=%p)\n", miname, context)); @@ -1307,6 +1447,7 @@ */ } + #define SWIG_CMPI_MI_FACTORY(ptype) \ CMPI##ptype##MI* _Generic_Create_##ptype##MI(const CMPIBroker* broker, \ const CMPIContext* context, const char* miname, CMPIStatus* st)\ @@ -1333,3 +1474,5 @@ SWIG_CMPI_MI_FACTORY(Method) SWIG_CMPI_MI_FACTORY(Association) SWIG_CMPI_MI_FACTORY(Indication) + +#undef _CMPI_SETFAIL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2008-09-29 13:38:48
|
Revision: 1049 http://omc.svn.sourceforge.net/omc/?rev=1049&view=rev Author: kkaempf Date: 2008-09-29 13:38:37 +0000 (Mon, 29 Sep 2008) Log Message: ----------- fix type errors (gcc warnings) Modified Paths: -------------- cmpi-bindings/trunk/swig/cmpi.i cmpi-bindings/trunk/swig/cmpi_callbacks.i Modified: cmpi-bindings/trunk/swig/cmpi.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi.i 2008-09-29 13:28:51 UTC (rev 1048) +++ cmpi-bindings/trunk/swig/cmpi.i 2008-09-29 13:38:37 UTC (rev 1049) @@ -83,13 +83,11 @@ ex = (CMPIException*)malloc(sizeof(CMPIException)); ex->error_code = st->rc; - const char* chars; - if (st->msg) - chars = CMGetCharsPtr(st->msg, NULL); - - if (chars) + if (st->msg) { + const char* chars = CMGetCharsPtr(st->msg, NULL); ex->description = strdup(chars); + } else ex->description = NULL; Modified: cmpi-bindings/trunk/swig/cmpi_callbacks.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-09-29 13:28:51 UTC (rev 1048) +++ cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-09-29 13:38:37 UTC (rev 1049) @@ -14,10 +14,7 @@ const char *id, const char *text) { - CMPIStatus st = { CMPI_RC_OK, NULL }; - - CMLogMessage($self, severity, id, text, &st); - RAISE_IF(st); + CMLogMessage($self, severity, id, text, NULL); } unsigned long capabilities() @@ -312,7 +309,7 @@ CMPIString* new_string(const char *s) { CMPIStatus st = { CMPI_RC_OK, NULL }; - CMPIStatus* result; + CMPIString* result; result = CMNewString($self, s, &st); RAISE_IF(st); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2008-09-29 13:28:55
|
Revision: 1048 http://omc.svn.sourceforge.net/omc/?rev=1048&view=rev Author: kkaempf Date: 2008-09-29 13:28:51 +0000 (Mon, 29 Sep 2008) Log Message: ----------- keep gcc happy: remove unused variable Modified Paths: -------------- cmpi-bindings/trunk/src/cmpi_provider_python.c Modified: cmpi-bindings/trunk/src/cmpi_provider_python.c =================================================================== --- cmpi-bindings/trunk/src/cmpi_provider_python.c 2008-09-29 09:03:15 UTC (rev 1047) +++ cmpi-bindings/trunk/src/cmpi_provider_python.c 2008-09-29 13:28:51 UTC (rev 1048) @@ -222,8 +222,6 @@ #define PY_CMPI_SETFAIL(msgstr) {if (st != NULL) st->rc = CMPI_RC_ERR_FAILED; st->msg = msgstr; } static int PyGlobalInitialize(const CMPIBroker* broker, CMPIStatus* st) { - int rc = 0; - _SBLIM_TRACE(1,("<%d/0x%x> PyGlobalInitialize() called", getpid(), pthread_self())); if (_PY_INIT) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2008-09-29 09:03:26
|
Revision: 1047 http://omc.svn.sourceforge.net/omc/?rev=1047&view=rev Author: kkaempf Date: 2008-09-29 09:03:15 +0000 (Mon, 29 Sep 2008) Log Message: ----------- honor DESTDIR Modified Paths: -------------- cmpi-bindings/trunk/swig/python/CMakeLists.txt Modified: cmpi-bindings/trunk/swig/python/CMakeLists.txt =================================================================== --- cmpi-bindings/trunk/swig/python/CMakeLists.txt 2008-09-28 20:28:16 UTC (rev 1046) +++ cmpi-bindings/trunk/swig/python/CMakeLists.txt 2008-09-29 09:03:15 UTC (rev 1047) @@ -65,4 +65,4 @@ INSTALL(FILES cmpi_pywbem_bindings.py DESTINATION ${PYTHON_SITE_DIR} ) #INSTALL(FILES Py_UnixProcessProvider.py DESTINATION /usr/lib/pycim ) -INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -m py_compile ${PYTHON_SITE_DIR}/cmpi.py ${PYTHON_SITE_DIR}/cmpi_pywbem_bindings.py)") +INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -m py_compile $ENV{DESTDIR}${PYTHON_SITE_DIR}/cmpi.py $ENV{DESTDIR}${PYTHON_SITE_DIR}/cmpi_pywbem_bindings.py)") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kk...@us...> - 2008-09-28 20:28:24
|
Revision: 1046 http://omc.svn.sourceforge.net/omc/?rev=1046&view=rev Author: kkaempf Date: 2008-09-28 20:28:16 +0000 (Sun, 28 Sep 2008) Log Message: ----------- compile at 'make install' Modified Paths: -------------- cmpi-bindings/trunk/swig/python/CMakeLists.txt Modified: cmpi-bindings/trunk/swig/python/CMakeLists.txt =================================================================== --- cmpi-bindings/trunk/swig/python/CMakeLists.txt 2008-09-27 16:47:58 UTC (rev 1045) +++ cmpi-bindings/trunk/swig/python/CMakeLists.txt 2008-09-28 20:28:16 UTC (rev 1046) @@ -7,15 +7,19 @@ SET (BUILD_SHARED_LIBS ON) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") -FIND_PACKAGE(PythonInterp) +FIND_PACKAGE(PythonInterp REQUIRED) -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write(sys.path[2])" OUTPUT_VARIABLE PYTHON_LIB_DIR) +EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib())" OUTPUT_VARIABLE PYTHON_LIB_DIR) +IF (NOT PYTHON_SITE_DIR) + SET (PYTHON_SITE_DIR ${PYTHON_LIB_DIR}) +ENDIF (NOT PYTHON_SITE_DIR) + MESSAGE(STATUS "Python executable: ${PYTHON_EXECUTABLE}") MESSAGE(STATUS "Python inc dir: ${PYTHON_INCLUDE_PATH}") MESSAGE(STATUS "Python lib dir: ${PYTHON_LIB_DIR}") #MESSAGE(STATUS "Python libraries: ${PYTHON_LIBRARIES}") -MESSAGE(STATUS "Python site dir: ${PYTHON_LIB_DIR}/site-packages") +MESSAGE(STATUS "Python site dir: ${PYTHON_SITE_DIR}") SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cmpi_wrap.c" ) SET( SWIG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/../cmpi.i" ) @@ -52,11 +56,13 @@ INSTALL(TARGETS ${NAME} LIBRARY DESTINATION ${CMPI_LIBRARY_DIR}) # .py: swig generated -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmpi.py DESTINATION ${PYTHON_LIB_DIR}/site-packages ) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmpi.py DESTINATION ${PYTHON_SITE_DIR} ) # # cmpi_pywbem_bindings.py: provider implementation # -INSTALL(FILES cmpi_pywbem_bindings.py DESTINATION ${PYTHON_LIB_DIR}/site-packages ) +INSTALL(FILES cmpi_pywbem_bindings.py DESTINATION ${PYTHON_SITE_DIR} ) #INSTALL(FILES Py_UnixProcessProvider.py DESTINATION /usr/lib/pycim ) + +INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -m py_compile ${PYTHON_SITE_DIR}/cmpi.py ${PYTHON_SITE_DIR}/cmpi_pywbem_bindings.py)") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-27 16:48:05
|
Revision: 1045 http://omc.svn.sourceforge.net/omc/?rev=1045&view=rev Author: bartw Date: 2008-09-27 16:47:58 +0000 (Sat, 27 Sep 2008) Log Message: ----------- commented out log statement that was crashing under Pegasus Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-27 16:45:50 UTC (rev 1044) +++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-27 16:47:58 UTC (rev 1045) @@ -383,8 +383,8 @@ #print '*** broker.name()', broker.name() #print '*** broker.capabilities()', broker.capabilities() #print '*** broker.version()', broker.version() - broker.LogMessage(1, 'LogID', - '** This should go through broker.LogMessage()') + #broker.LogMessage(1, 'LogID', + # '** This should go through broker.LogMessage()') def enum_instance_names(self, ctx, rslt, objname): print 'provider.py: In enum_instance_names()' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-27 16:45:59
|
Revision: 1044 http://omc.svn.sourceforge.net/omc/?rev=1044&view=rev Author: bartw Date: 2008-09-27 16:45:50 +0000 (Sat, 27 Sep 2008) Log Message: ----------- changed namespace to root/suse Modified Paths: -------------- pybase/trunk/OMC_Base.sfcb.reg pybase/trunk/OMC_ComputerSystem.peg.reg pybase/trunk/OMC_InitdService.peg.reg pybase/trunk/OMC_LogicalFile.peg.reg pybase/trunk/OMC_OperatingSystem.peg.reg pybase/trunk/OMC_SyslogNG.peg.reg pybase/trunk/OMC_TimeService.peg.reg pybase/trunk/OMC_UnixProcess.peg.reg Added Paths: ----------- pybase/trunk/deploy.mof Removed Paths: ------------- pybase/trunk/OMC_Base.mof Deleted: pybase/trunk/OMC_Base.mof =================================================================== --- pybase/trunk/OMC_Base.mof 2008-09-27 00:23:10 UTC (rev 1043) +++ pybase/trunk/OMC_Base.mof 2008-09-27 16:45:50 UTC (rev 1044) @@ -1,7 +0,0 @@ -#pragma include ("OMC_ComputerSystem.mof") -#pragma include ("OMC_OperatingSystem.mof") -#pragma include ("OMC_LogicalFile.mof") -#pragma include ("OMC_UnixProcess.mof") -#pragma include ("OMC_InitdService.mof") -#pragma include ("OMC_TimeService.mof") -#pragma include ("OMC_SyslogNG.mof") Modified: pybase/trunk/OMC_Base.sfcb.reg =================================================================== --- pybase/trunk/OMC_Base.sfcb.reg 2008-09-27 00:23:10 UTC (rev 1043) +++ pybase/trunk/OMC_Base.sfcb.reg 2008-09-27 16:45:50 UTC (rev 1044) @@ -2,185 +2,185 @@ provider: OMC_ComputerSystem location: pyCmpiProvider type: instance method - namespace: root/cimv2 + namespace: root/suse # Operating System [OMC_OperatingSystem] provider: OMC_OperatingSystem location: pyCmpiProvider type: instance method - namespace: root/cimv2 + namespace: root/suse [OMC_InstalledOS] provider: OMC_OperatingSystem location: pyCmpiProvider type: instance association - namespace: root/cimv2 + namespace: root/suse [OMC_RunningOS] provider: OMC_OperatingSystem location: pyCmpiProvider type: instance association - namespace: root/cimv2 + namespace: root/suse # Unix Process [OMC_UnixProcess] provider: OMC_UnixProcess location: pyCmpiProvider type: instance method - namespace: root/cimv2 + namespace: root/suse [OMC_ProcessExecutable] provider: OMC_UnixProcess location: pyCmpiProvider type: instance association - namespace: root/cimv2 + namespace: root/suse [OMC_OSProcess] provider: OMC_UnixProcess location: pyCmpiProvider type: instance association - namespace: root/cimv2 + namespace: root/suse # Logical File [OMC_LinuxDirectoryContainsFile] provider: OMC_LogicalFile location: pyCmpiProvider type: instance association - namespace: root/cimv2 + namespace: root/suse [OMC_LinuxFileIdentity] provider: OMC_LogicalFile location: pyCmpiProvider type: instance association - namespace: root/cimv2 + namespace: root/suse [OMC_LinuxFile] provider: OMC_LogicalFile location: pyCmpiProvider type: instance - namespace: root/cimv2 + namespace: root/suse [OMC_LinuxDataFile] provider: OMC_LogicalFile location: pyCmpiProvider type: instance method - namespace: root/cimv2 + namespace: root/suse [OMC_LinuxSocketFile] provider: OMC_LogicalFile location: pyCmpiProvider type: instance - namespace: root/cimv2 + namespace: root/suse [OMC_LinuxDeviceFile] provider: OMC_LogicalFile location: pyCmpiProvider type: instance - namespace: root/cimv2 + namespace: root/suse [OMC_LinuxDirectory] provider: OMC_LogicalFile location: pyCmpiProvider type: instance - namespace: root/cimv2 + namespace: root/suse [OMC_LinuxFIFOPipeFile] provider: OMC_LogicalFile location: pyCmpiProvider type: instance - namespace: root/cimv2 + namespace: root/suse [OMC_LinuxSymbolicLink] provider: OMC_LogicalFile location: pyCmpiProvider type: instance - namespace: root/cimv2 + namespace: root/suse # Initd service [OMC_InitdService] provider: OMC_InitdService location: pyCmpiProvider type: instance method - namespace: root/cimv2 + namespace: root/suse # Syslog [OMC_SyslogNGRecordLogCapabilities] provider: OMC_SyslogNG location: pyCmpiProvider type: instance - namespace: root/cimv2 + namespace: root/suse [OMC_SyslogNGRecordLogCapabilities] provider: OMC_SyslogNG location: pyCmpiProvider type: instance - namespace: root/cimv2 + namespace: root/suse [OMC_SyslogNGUseOfLog] provider: OMC_SyslogNG location: pyCmpiProvider type: instance association - namespace: root/cimv2 + namespace: root/suse [OMC_SyslogNGLogManagesRecord] provider: OMC_SyslogNG location: pyCmpiProvider type: instance association - namespace: root/cimv2 + namespace: root/suse [OMC_SyslogNGLogRecord] provider: OMC_SyslogNG location: pyCmpiProvider type: instance - namespace: root/cimv2 + namespace: root/suse [OMC_SyslogNGRecordLog] provider: OMC_SyslogNG location: pyCmpiProvider type: instance method - namespace: root/cimv2 + namespace: root/suse # TimeService [OMC_SystemTimeService] provider: OMC_TimeService location: pyCmpiProvider type: instance method - namespace: root/cimv2 + namespace: root/suse [OMC_HostedTimeService] provider: OMC_TimeService location: pyCmpiProvider type: instance association - namespace: root/cimv2 + namespace: root/suse [OMC_RemoteTimeServicePort] provider: OMC_TimeService location: pyCmpiProvider type: instance method - namespace: root/cimv2 + namespace: root/suse [OMC_TimeServiceAccessBySAP] provider: OMC_TimeService location: pyCmpiProvider type: instance association - namespace: root/cimv2 + namespace: root/suse [OMC_TimeZoneSettingData] provider: OMC_TimeService location: pyCmpiProvider type: instance - namespace: root/cimv2 + namespace: root/suse [OMC_TimeServiceTimeZoneSettingData] provider: OMC_TimeService location: pyCmpiProvider type: instance association - namespace: root/cimv2 + namespace: root/suse [OMC_TimeServiceAvailableToElement] provider: OMC_TimeService location: pyCmpiProvider type: instance association - namespace: root/cimv2 + namespace: root/suse Modified: pybase/trunk/OMC_ComputerSystem.peg.reg =================================================================== --- pybase/trunk/OMC_ComputerSystem.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) +++ pybase/trunk/OMC_ComputerSystem.peg.reg 2008-09-27 16:45:50 UTC (rev 1044) @@ -22,7 +22,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_ComputerSystem.py"; ProviderName = "OMC_ComputerSystem"; ClassName = "OMC_ComputerSystem"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,5}; // Instance, Method }; @@ -32,7 +32,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_ComputerSystem.py"; ProviderName = "OMC_ComputerSystem"; ClassName = "OMC_HostNameSettingData"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2}; // Instance }; @@ -42,7 +42,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_ComputerSystem.py"; ProviderName = "OMC_ComputerSystem"; ClassName = "OMC_ComputerSystemHostNameSettingData"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,3}; // Instance, Associator }; Modified: pybase/trunk/OMC_InitdService.peg.reg =================================================================== --- pybase/trunk/OMC_InitdService.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) +++ pybase/trunk/OMC_InitdService.peg.reg 2008-09-27 16:45:50 UTC (rev 1044) @@ -22,7 +22,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_InitdService.py"; ProviderName = "OMC_InitdService"; ClassName = "OMC_InitdService"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,5}; // Instance, Method }; Modified: pybase/trunk/OMC_LogicalFile.peg.reg =================================================================== --- pybase/trunk/OMC_LogicalFile.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) +++ pybase/trunk/OMC_LogicalFile.peg.reg 2008-09-27 16:45:50 UTC (rev 1044) @@ -22,7 +22,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; ProviderName = "OMC_LogicalFile"; ClassName = "OMC_LinuxDirectoryContainsFile"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,3}; // Instance, Association }; @@ -32,7 +32,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; ProviderName = "OMC_LogicalFile"; ClassName = "OMC_LinuxFileIdentity"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,3}; // Instance, Association }; @@ -42,7 +42,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; ProviderName = "OMC_LogicalFile"; ClassName = "OMC_LinuxFile"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2}; // Instance }; @@ -52,7 +52,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; ProviderName = "OMC_LogicalFile"; ClassName = "OMC_LinuxDataFile"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,5}; // Instance, Method }; @@ -62,7 +62,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; ProviderName = "OMC_LogicalFile"; ClassName = "OMC_LinuxSocketFile"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2}; // Instance }; @@ -72,7 +72,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; ProviderName = "OMC_LogicalFile"; ClassName = "OMC_LinuxDeviceFile"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2}; // Instance }; @@ -82,7 +82,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; ProviderName = "OMC_LogicalFile"; ClassName = "OMC_LinuxDirectory"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2}; // Instance }; @@ -92,7 +92,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; ProviderName = "OMC_LogicalFile"; ClassName = "OMC_LinuxFIFOPipeFile"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2}; // Instance }; @@ -102,7 +102,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; ProviderName = "OMC_LogicalFile"; ClassName = "OMC_LinuxSymbolicLink"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2}; // Instance }; Modified: pybase/trunk/OMC_OperatingSystem.peg.reg =================================================================== --- pybase/trunk/OMC_OperatingSystem.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) +++ pybase/trunk/OMC_OperatingSystem.peg.reg 2008-09-27 16:45:50 UTC (rev 1044) @@ -22,7 +22,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_OperatingSystem.py"; ProviderName = "OMC_OperatingSystem"; ClassName = "OMC_OperatingSystem"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,5}; // Instance, Method }; @@ -32,7 +32,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_OperatingSystem.py"; ProviderName = "OMC_OperatingSystem"; ClassName = "OMC_InstalledOS"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,3}; // Instance, Association }; @@ -42,7 +42,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_OperatingSystem.py"; ProviderName = "OMC_OperatingSystem"; ClassName = "OMC_RunningOS"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,3}; // Instance, Association }; Modified: pybase/trunk/OMC_SyslogNG.peg.reg =================================================================== --- pybase/trunk/OMC_SyslogNG.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) +++ pybase/trunk/OMC_SyslogNG.peg.reg 2008-09-27 16:45:50 UTC (rev 1044) @@ -20,7 +20,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; ProviderName = "OMC_SyslogNG"; ClassName = "OMC_SyslogNGRecordLog"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,5}; // Instance, Method }; @@ -30,7 +30,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; ProviderName = "OMC_SyslogNG"; ClassName = "OMC_SyslogNGLogRecord"; - Namespaces = {"root/cimv2"}; // TODO + Namespaces = {"root/suse"}; // TODO ProviderType = {2}; // Instance }; @@ -40,7 +40,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; ProviderName = "OMC_SyslogNG"; ClassName = "OMC_SyslogNGLogManagesRecord"; - Namespaces = {"root/cimv2"}; // TODO + Namespaces = {"root/suse"}; // TODO ProviderType = {2,3}; // Instance, Associator }; @@ -50,7 +50,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; ProviderName = "OMC_SyslogNG"; ClassName = "OMC_SyslogNGUseOfLog"; - Namespaces = {"root/cimv2"}; // TODO + Namespaces = {"root/suse"}; // TODO ProviderType = {2,3}; // Instance, Associator }; @@ -60,7 +60,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; ProviderName = "OMC_SyslogNG"; ClassName = "OMC_SyslogNGRecordLogCapabilities"; - Namespaces = {"root/cimv2"}; // TODO + Namespaces = {"root/suse"}; // TODO ProviderType = {2}; // Instance }; @@ -70,7 +70,7 @@ ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; ProviderName = "OMC_SyslogNG"; ClassName = "OMC_SyslogNGRecordLogToCapabilities"; - Namespaces = {"root/cimv2"}; // TODO + Namespaces = {"root/suse"}; // TODO ProviderType = {2,3}; // Instance, Associator }; Modified: pybase/trunk/OMC_TimeService.peg.reg =================================================================== --- pybase/trunk/OMC_TimeService.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) +++ pybase/trunk/OMC_TimeService.peg.reg 2008-09-27 16:45:50 UTC (rev 1044) @@ -20,7 +20,7 @@ ProviderModuleName = "OMC_TimeServiceProvider_Module"; ProviderName = "OMC_TimeService"; ClassName = "OMC_SystemTimeService"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,5}; // Instance, Method }; @@ -30,7 +30,7 @@ ProviderModuleName = "OMC_TimeServiceProvider_Module"; ProviderName = "OMC_TimeService"; ClassName = "OMC_HostedTimeService"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,3}; // Instance, Associator }; @@ -40,7 +40,7 @@ ProviderModuleName = "OMC_TimeServiceProvider_Module"; ProviderName = "OMC_TimeService"; ClassName = "OMC_RemoteTimeServicePort"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,5}; // Instance, Method }; @@ -50,7 +50,7 @@ ProviderModuleName = "OMC_TimeServiceProvider_Module"; ProviderName = "OMC_TimeService"; ClassName = "OMC_TimeServiceAccessBySAP"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,3}; // Instance, Associator }; @@ -60,7 +60,7 @@ ProviderModuleName = "OMC_TimeServiceProvider_Module"; ProviderName = "OMC_TimeService"; ClassName = "OMC_TimeZoneSettingData"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2}; // Instance }; @@ -70,7 +70,7 @@ ProviderModuleName = "OMC_TimeServiceProvider_Module"; ProviderName = "OMC_TimeService"; ClassName = "OMC_TimeServiceTimeZoneSettingData"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,3}; // Instance, Associator }; @@ -80,7 +80,7 @@ ProviderModuleName = "OMC_TimeServiceProvider_Module"; ProviderName = "OMC_TimeService"; ClassName = "OMC_TimeServiceAvailableToElement"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,3}; // Instance, Associator }; Modified: pybase/trunk/OMC_UnixProcess.peg.reg =================================================================== --- pybase/trunk/OMC_UnixProcess.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) +++ pybase/trunk/OMC_UnixProcess.peg.reg 2008-09-27 16:45:50 UTC (rev 1044) @@ -21,7 +21,7 @@ ProviderModuleName = "OMC_UnixProcessProvider_Module"; ProviderName = "OMC_UnixProcess"; ClassName = "OMC_UnixProcess"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,5}; // Instance, Method }; @@ -31,7 +31,7 @@ ProviderModuleName = "OMC_UnixProcessProvider_Module"; ProviderName = "OMC_UnixProcess"; ClassName = "OMC_ProcessExecutable"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,3}; // Instance, Association }; @@ -41,7 +41,7 @@ ProviderModuleName = "OMC_UnixProcessProvider_Module"; ProviderName = "OMC_UnixProcess"; ClassName = "OMC_OSProcess"; - Namespaces = {"root/cimv2"}; + Namespaces = {"root/suse"}; ProviderType = {2,3}; // Instance, Association }; Copied: pybase/trunk/deploy.mof (from rev 976, pybase/trunk/OMC_Base.mof) =================================================================== --- pybase/trunk/deploy.mof (rev 0) +++ pybase/trunk/deploy.mof 2008-09-27 16:45:50 UTC (rev 1044) @@ -0,0 +1,8 @@ +#pragma namespace ("root/suse") +#pragma include ("OMC_ComputerSystem.mof") +#pragma include ("OMC_OperatingSystem.mof") +#pragma include ("OMC_LogicalFile.mof") +#pragma include ("OMC_UnixProcess.mof") +#pragma include ("OMC_InitdService.mof") +#pragma include ("OMC_TimeService.mof") +#pragma include ("OMC_SyslogNG.mof") Property changes on: pybase/trunk/deploy.mof ___________________________________________________________________ Added: svn:mergeinfo + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-27 00:23:17
|
Revision: 1043 http://omc.svn.sourceforge.net/omc/?rev=1043&view=rev Author: bartw Date: 2008-09-27 00:23:10 +0000 (Sat, 27 Sep 2008) Log Message: ----------- renamed pegasus reg files Modified Paths: -------------- pybase/trunk/omc-pybase-providers.spec Added Paths: ----------- pybase/trunk/OMC_ComputerSystem.peg.reg pybase/trunk/OMC_InitdService.peg.reg pybase/trunk/OMC_LogicalFile.peg.reg pybase/trunk/OMC_OperatingSystem.peg.reg pybase/trunk/OMC_SyslogNG.peg.reg pybase/trunk/OMC_TimeService.peg.reg pybase/trunk/OMC_UnixProcess.peg.reg Removed Paths: ------------- pybase/trunk/OMC_ComputerSystem-peg.reg pybase/trunk/OMC_InitdService-peg.reg pybase/trunk/OMC_LogicalFile-peg.reg pybase/trunk/OMC_OperatingSystem-peg.reg pybase/trunk/OMC_SyslogNG-peg.reg pybase/trunk/OMC_TimeService-peg.reg pybase/trunk/OMC_UnixProcess-peg.reg Deleted: pybase/trunk/OMC_ComputerSystem-peg.reg =================================================================== --- pybase/trunk/OMC_ComputerSystem-peg.reg 2008-09-27 00:20:05 UTC (rev 1042) +++ pybase/trunk/OMC_ComputerSystem-peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -1,48 +0,0 @@ -//////// OMC_ComputerSystem -instance of PG_ProviderModule -{ - Name = "/usr/lib/pycim/OMC_ComputerSystem.py"; - InterfaceType = "CMPI"; - InterfaceVersion = "2.0.0"; - Location = "pyCmpiProvider"; - UserContext = 2; // Requestor - Vendor = "OMC"; - Version = "0.1.0"; -}; - -instance of PG_Provider -{ - Name = "OMC_ComputerSystem"; - ProviderModuleName = "/usr/lib/pycim/OMC_ComputerSystem.py"; -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_ComputerSystem"; - ProviderModuleName = "/usr/lib/pycim/OMC_ComputerSystem.py"; - ProviderName = "OMC_ComputerSystem"; - ClassName = "OMC_ComputerSystem"; - Namespaces = {"root/cimv2"}; - ProviderType = {2,5}; // Instance, Method -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_HostNameSettingData"; - ProviderModuleName = "/usr/lib/pycim/OMC_ComputerSystem.py"; - ProviderName = "OMC_ComputerSystem"; - ClassName = "OMC_HostNameSettingData"; - Namespaces = {"root/cimv2"}; - ProviderType = {2}; // Instance -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_ComputerSystemHostNameSettingData"; - ProviderModuleName = "/usr/lib/pycim/OMC_ComputerSystem.py"; - ProviderName = "OMC_ComputerSystem"; - ClassName = "OMC_ComputerSystemHostNameSettingData"; - Namespaces = {"root/cimv2"}; - ProviderType = {2,3}; // Instance, Associator -}; - Copied: pybase/trunk/OMC_ComputerSystem.peg.reg (from rev 984, pybase/trunk/OMC_ComputerSystem-peg.reg) =================================================================== --- pybase/trunk/OMC_ComputerSystem.peg.reg (rev 0) +++ pybase/trunk/OMC_ComputerSystem.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -0,0 +1,48 @@ +//////// OMC_ComputerSystem +instance of PG_ProviderModule +{ + Name = "/usr/lib/pycim/OMC_ComputerSystem.py"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; + Location = "pyCmpiProvider"; + UserContext = 2; // Requestor + Vendor = "OMC"; + Version = "0.1.0"; +}; + +instance of PG_Provider +{ + Name = "OMC_ComputerSystem"; + ProviderModuleName = "/usr/lib/pycim/OMC_ComputerSystem.py"; +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_ComputerSystem"; + ProviderModuleName = "/usr/lib/pycim/OMC_ComputerSystem.py"; + ProviderName = "OMC_ComputerSystem"; + ClassName = "OMC_ComputerSystem"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,5}; // Instance, Method +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_HostNameSettingData"; + ProviderModuleName = "/usr/lib/pycim/OMC_ComputerSystem.py"; + ProviderName = "OMC_ComputerSystem"; + ClassName = "OMC_HostNameSettingData"; + Namespaces = {"root/cimv2"}; + ProviderType = {2}; // Instance +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_ComputerSystemHostNameSettingData"; + ProviderModuleName = "/usr/lib/pycim/OMC_ComputerSystem.py"; + ProviderName = "OMC_ComputerSystem"; + ClassName = "OMC_ComputerSystemHostNameSettingData"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Associator +}; + Deleted: pybase/trunk/OMC_InitdService-peg.reg =================================================================== --- pybase/trunk/OMC_InitdService-peg.reg 2008-09-27 00:20:05 UTC (rev 1042) +++ pybase/trunk/OMC_InitdService-peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -1,28 +0,0 @@ -//////// OMC_InitdService -instance of PG_ProviderModule -{ - Name = "/usr/lib/pycim/OMC_InitdService.py"; - InterfaceType = "CMPI"; - InterfaceVersion = "2.0.0"; - Location = "pyCmpiProvider"; - UserContext = 2; // Requestor - 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 -}; - Copied: pybase/trunk/OMC_InitdService.peg.reg (from rev 984, pybase/trunk/OMC_InitdService-peg.reg) =================================================================== --- pybase/trunk/OMC_InitdService.peg.reg (rev 0) +++ pybase/trunk/OMC_InitdService.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -0,0 +1,28 @@ +//////// OMC_InitdService +instance of PG_ProviderModule +{ + Name = "/usr/lib/pycim/OMC_InitdService.py"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; + Location = "pyCmpiProvider"; + UserContext = 2; // Requestor + 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 +}; + Property changes on: pybase/trunk/OMC_InitdService.peg.reg ___________________________________________________________________ Added: svn:mergeinfo + Deleted: pybase/trunk/OMC_LogicalFile-peg.reg =================================================================== --- pybase/trunk/OMC_LogicalFile-peg.reg 2008-09-27 00:20:05 UTC (rev 1042) +++ pybase/trunk/OMC_LogicalFile-peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -1,109 +0,0 @@ -//////// OMC_LogicalFile -instance of PG_ProviderModule -{ - Name = "/usr/lib/pycim/OMC_LogicalFile.py"; - InterfaceType = "CMPI"; - InterfaceVersion = "2.0.0"; - Location = "pyCmpiProvider"; - UserContext = 2; // Requestor - 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_LinuxSocketFile"; - ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; - ProviderName = "OMC_LogicalFile"; - ClassName = "OMC_LinuxSocketFile"; - Namespaces = {"root/cimv2"}; - ProviderType = {2}; // Instance -}; - -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 -}; - - Copied: pybase/trunk/OMC_LogicalFile.peg.reg (from rev 984, pybase/trunk/OMC_LogicalFile-peg.reg) =================================================================== --- pybase/trunk/OMC_LogicalFile.peg.reg (rev 0) +++ pybase/trunk/OMC_LogicalFile.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -0,0 +1,109 @@ +//////// OMC_LogicalFile +instance of PG_ProviderModule +{ + Name = "/usr/lib/pycim/OMC_LogicalFile.py"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; + Location = "pyCmpiProvider"; + UserContext = 2; // Requestor + 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_LinuxSocketFile"; + ProviderModuleName = "/usr/lib/pycim/OMC_LogicalFile.py"; + ProviderName = "OMC_LogicalFile"; + ClassName = "OMC_LinuxSocketFile"; + Namespaces = {"root/cimv2"}; + ProviderType = {2}; // Instance +}; + +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 +}; + + Property changes on: pybase/trunk/OMC_LogicalFile.peg.reg ___________________________________________________________________ Added: svn:mergeinfo + Deleted: pybase/trunk/OMC_OperatingSystem-peg.reg =================================================================== --- pybase/trunk/OMC_OperatingSystem-peg.reg 2008-09-27 00:20:05 UTC (rev 1042) +++ pybase/trunk/OMC_OperatingSystem-peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -1,48 +0,0 @@ -//////// OMC_OperatingSystem -instance of PG_ProviderModule -{ - Name = "/usr/lib/pycim/OMC_OperatingSystem.py"; - InterfaceType = "CMPI"; - InterfaceVersion = "2.0.0"; - Location = "pyCmpiProvider"; - UserContext = 2; // Requestor - 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 -}; - Copied: pybase/trunk/OMC_OperatingSystem.peg.reg (from rev 984, pybase/trunk/OMC_OperatingSystem-peg.reg) =================================================================== --- pybase/trunk/OMC_OperatingSystem.peg.reg (rev 0) +++ pybase/trunk/OMC_OperatingSystem.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -0,0 +1,48 @@ +//////// OMC_OperatingSystem +instance of PG_ProviderModule +{ + Name = "/usr/lib/pycim/OMC_OperatingSystem.py"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; + Location = "pyCmpiProvider"; + UserContext = 2; // Requestor + 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 +}; + Property changes on: pybase/trunk/OMC_OperatingSystem.peg.reg ___________________________________________________________________ Added: svn:mergeinfo + Deleted: pybase/trunk/OMC_SyslogNG-peg.reg =================================================================== --- pybase/trunk/OMC_SyslogNG-peg.reg 2008-09-27 00:20:05 UTC (rev 1042) +++ pybase/trunk/OMC_SyslogNG-peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -1,76 +0,0 @@ -// Pegasus Provider registration for OMC_SyslogNGRecordLog -instance of PG_ProviderModule -{ - Name = "/usr/lib/pycim/OMC_SyslogNG.py"; - InterfaceType = "CMPI"; - InterfaceVersion = "2.0.0"; - Location = "pyCmpiProvider"; - UserContext = 2; // Requestor - Vendor = "OMC"; - Version = "1.0"; -}; -instance of PG_Provider -{ - Name = "OMC_SyslogNG"; - ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; -}; -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_SyslogNGRecordLog"; - ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; - ProviderName = "OMC_SyslogNG"; - ClassName = "OMC_SyslogNGRecordLog"; - Namespaces = {"root/cimv2"}; - ProviderType = {2,5}; // Instance, Method -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_SyslogNGLogRecord"; - ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; - ProviderName = "OMC_SyslogNG"; - ClassName = "OMC_SyslogNGLogRecord"; - Namespaces = {"root/cimv2"}; // TODO - ProviderType = {2}; // Instance -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_SyslogNGLogManagesRecord"; - ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; - ProviderName = "OMC_SyslogNG"; - ClassName = "OMC_SyslogNGLogManagesRecord"; - Namespaces = {"root/cimv2"}; // TODO - ProviderType = {2,3}; // Instance, Associator -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_SyslogNGUseOfLog"; - ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; - ProviderName = "OMC_SyslogNG"; - ClassName = "OMC_SyslogNGUseOfLog"; - Namespaces = {"root/cimv2"}; // TODO - ProviderType = {2,3}; // Instance, Associator -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_SyslogNGRecordLogCapabilities"; - ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; - ProviderName = "OMC_SyslogNG"; - ClassName = "OMC_SyslogNGRecordLogCapabilities"; - Namespaces = {"root/cimv2"}; // TODO - ProviderType = {2}; // Instance -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_SyslogNGRecordLogToCapabilities"; - ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; - ProviderName = "OMC_SyslogNG"; - ClassName = "OMC_SyslogNGRecordLogToCapabilities"; - Namespaces = {"root/cimv2"}; // TODO - ProviderType = {2,3}; // Instance, Associator -}; - Copied: pybase/trunk/OMC_SyslogNG.peg.reg (from rev 984, pybase/trunk/OMC_SyslogNG-peg.reg) =================================================================== --- pybase/trunk/OMC_SyslogNG.peg.reg (rev 0) +++ pybase/trunk/OMC_SyslogNG.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -0,0 +1,76 @@ +// Pegasus Provider registration for OMC_SyslogNGRecordLog +instance of PG_ProviderModule +{ + Name = "/usr/lib/pycim/OMC_SyslogNG.py"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; + Location = "pyCmpiProvider"; + UserContext = 2; // Requestor + Vendor = "OMC"; + Version = "1.0"; +}; +instance of PG_Provider +{ + Name = "OMC_SyslogNG"; + ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; +}; +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_SyslogNGRecordLog"; + ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; + ProviderName = "OMC_SyslogNG"; + ClassName = "OMC_SyslogNGRecordLog"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,5}; // Instance, Method +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_SyslogNGLogRecord"; + ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; + ProviderName = "OMC_SyslogNG"; + ClassName = "OMC_SyslogNGLogRecord"; + Namespaces = {"root/cimv2"}; // TODO + ProviderType = {2}; // Instance +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_SyslogNGLogManagesRecord"; + ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; + ProviderName = "OMC_SyslogNG"; + ClassName = "OMC_SyslogNGLogManagesRecord"; + Namespaces = {"root/cimv2"}; // TODO + ProviderType = {2,3}; // Instance, Associator +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_SyslogNGUseOfLog"; + ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; + ProviderName = "OMC_SyslogNG"; + ClassName = "OMC_SyslogNGUseOfLog"; + Namespaces = {"root/cimv2"}; // TODO + ProviderType = {2,3}; // Instance, Associator +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_SyslogNGRecordLogCapabilities"; + ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; + ProviderName = "OMC_SyslogNG"; + ClassName = "OMC_SyslogNGRecordLogCapabilities"; + Namespaces = {"root/cimv2"}; // TODO + ProviderType = {2}; // Instance +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_SyslogNGRecordLogToCapabilities"; + ProviderModuleName = "/usr/lib/pycim/OMC_SyslogNG.py"; + ProviderName = "OMC_SyslogNG"; + ClassName = "OMC_SyslogNGRecordLogToCapabilities"; + Namespaces = {"root/cimv2"}; // TODO + ProviderType = {2,3}; // Instance, Associator +}; + Property changes on: pybase/trunk/OMC_SyslogNG.peg.reg ___________________________________________________________________ Added: svn:mergeinfo + Deleted: pybase/trunk/OMC_TimeService-peg.reg =================================================================== --- pybase/trunk/OMC_TimeService-peg.reg 2008-09-27 00:20:05 UTC (rev 1042) +++ pybase/trunk/OMC_TimeService-peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -1,94 +0,0 @@ -instance of PG_ProviderModule -{ - Name = "OMC_TimeServiceProvider_Module"; - InterfaceType = "CMPI"; - InterfaceVersion = "2.0.0"; - Location = "pyCmpiProvider"; - UserContext = 2; // Requestor - Vendor = "OMC"; - Version = "1.0"; -}; -instance of PG_Provider -{ - Name = "OMC_TimeService"; - ProviderModuleName = "OMC_TimeServiceProvider_Module"; -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_TimeService_Capability1"; - ProviderModuleName = "OMC_TimeServiceProvider_Module"; - ProviderName = "OMC_TimeService"; - ClassName = "OMC_SystemTimeService"; - Namespaces = {"root/cimv2"}; - ProviderType = {2,5}; // Instance, Method -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_TimeService_Capability4"; - ProviderModuleName = "OMC_TimeServiceProvider_Module"; - ProviderName = "OMC_TimeService"; - ClassName = "OMC_HostedTimeService"; - Namespaces = {"root/cimv2"}; - ProviderType = {2,3}; // Instance, Associator -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_TimeService_Capability2"; - ProviderModuleName = "OMC_TimeServiceProvider_Module"; - ProviderName = "OMC_TimeService"; - ClassName = "OMC_RemoteTimeServicePort"; - Namespaces = {"root/cimv2"}; - ProviderType = {2,5}; // Instance, Method -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_TimeService_Capability5"; - ProviderModuleName = "OMC_TimeServiceProvider_Module"; - ProviderName = "OMC_TimeService"; - ClassName = "OMC_TimeServiceAccessBySAP"; - Namespaces = {"root/cimv2"}; - ProviderType = {2,3}; // Instance, Associator -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_TimeService_Capability3"; - ProviderModuleName = "OMC_TimeServiceProvider_Module"; - ProviderName = "OMC_TimeService"; - ClassName = "OMC_TimeZoneSettingData"; - Namespaces = {"root/cimv2"}; - ProviderType = {2}; // Instance -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_TimeService_Capability6"; - ProviderModuleName = "OMC_TimeServiceProvider_Module"; - ProviderName = "OMC_TimeService"; - 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"; - ClassName = "OMC_TimeServiceAvailableToElement"; - Namespaces = {"root/cimv2"}; - ProviderType = {2,3}; // Instance, Associator -}; - - - - - - - - - Copied: pybase/trunk/OMC_TimeService.peg.reg (from rev 984, pybase/trunk/OMC_TimeService-peg.reg) =================================================================== --- pybase/trunk/OMC_TimeService.peg.reg (rev 0) +++ pybase/trunk/OMC_TimeService.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -0,0 +1,94 @@ +instance of PG_ProviderModule +{ + Name = "OMC_TimeServiceProvider_Module"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; + Location = "pyCmpiProvider"; + UserContext = 2; // Requestor + Vendor = "OMC"; + Version = "1.0"; +}; +instance of PG_Provider +{ + Name = "OMC_TimeService"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability1"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService"; + ClassName = "OMC_SystemTimeService"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,5}; // Instance, Method +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability4"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService"; + ClassName = "OMC_HostedTimeService"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Associator +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability2"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService"; + ClassName = "OMC_RemoteTimeServicePort"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,5}; // Instance, Method +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability5"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService"; + ClassName = "OMC_TimeServiceAccessBySAP"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Associator +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability3"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService"; + ClassName = "OMC_TimeZoneSettingData"; + Namespaces = {"root/cimv2"}; + ProviderType = {2}; // Instance +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_TimeService_Capability6"; + ProviderModuleName = "OMC_TimeServiceProvider_Module"; + ProviderName = "OMC_TimeService"; + 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"; + ClassName = "OMC_TimeServiceAvailableToElement"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Associator +}; + + + + + + + + + Property changes on: pybase/trunk/OMC_TimeService.peg.reg ___________________________________________________________________ Added: svn:mergeinfo + Deleted: pybase/trunk/OMC_UnixProcess-peg.reg =================================================================== --- pybase/trunk/OMC_UnixProcess-peg.reg 2008-09-27 00:20:05 UTC (rev 1042) +++ pybase/trunk/OMC_UnixProcess-peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -1,48 +0,0 @@ -instance of PG_ProviderModule -{ - Name = "OMC_UnixProcessProvider_Module"; - InterfaceType = "CMPI"; - InterfaceVersion = "2.0.0"; - Location = "pyCmpiProvider"; - UserContext = 2; // Requestor - Vendor = "OMC"; - Version = "1.0"; -}; - -instance of PG_Provider -{ - Name = "OMC_UnixProcess"; - ProviderModuleName = "OMC_UnixProcessProvider_Module"; -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_UnixProcess"; - ProviderModuleName = "OMC_UnixProcessProvider_Module"; - ProviderName = "OMC_UnixProcess"; - ClassName = "OMC_UnixProcess"; - Namespaces = {"root/cimv2"}; - ProviderType = {2,5}; // Instance, Method -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_ProcessExecutable"; - ProviderModuleName = "OMC_UnixProcessProvider_Module"; - ProviderName = "OMC_UnixProcess"; - ClassName = "OMC_ProcessExecutable"; - Namespaces = {"root/cimv2"}; - ProviderType = {2,3}; // Instance, Association -}; - -instance of PG_ProviderCapabilities -{ - CapabilityID = "OMC_OSProcess"; - ProviderModuleName = "OMC_UnixProcessProvider_Module"; - ProviderName = "OMC_UnixProcess"; - ClassName = "OMC_OSProcess"; - Namespaces = {"root/cimv2"}; - ProviderType = {2,3}; // Instance, Association -}; - - Copied: pybase/trunk/OMC_UnixProcess.peg.reg (from rev 984, pybase/trunk/OMC_UnixProcess-peg.reg) =================================================================== --- pybase/trunk/OMC_UnixProcess.peg.reg (rev 0) +++ pybase/trunk/OMC_UnixProcess.peg.reg 2008-09-27 00:23:10 UTC (rev 1043) @@ -0,0 +1,48 @@ +instance of PG_ProviderModule +{ + Name = "OMC_UnixProcessProvider_Module"; + InterfaceType = "CMPI"; + InterfaceVersion = "2.0.0"; + Location = "pyCmpiProvider"; + UserContext = 2; // Requestor + Vendor = "OMC"; + Version = "1.0"; +}; + +instance of PG_Provider +{ + Name = "OMC_UnixProcess"; + ProviderModuleName = "OMC_UnixProcessProvider_Module"; +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_UnixProcess"; + ProviderModuleName = "OMC_UnixProcessProvider_Module"; + ProviderName = "OMC_UnixProcess"; + ClassName = "OMC_UnixProcess"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,5}; // Instance, Method +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_ProcessExecutable"; + ProviderModuleName = "OMC_UnixProcessProvider_Module"; + ProviderName = "OMC_UnixProcess"; + ClassName = "OMC_ProcessExecutable"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Association +}; + +instance of PG_ProviderCapabilities +{ + CapabilityID = "OMC_OSProcess"; + ProviderModuleName = "OMC_UnixProcessProvider_Module"; + ProviderName = "OMC_UnixProcess"; + ClassName = "OMC_OSProcess"; + Namespaces = {"root/cimv2"}; + ProviderType = {2,3}; // Instance, Association +}; + + Property changes on: pybase/trunk/OMC_UnixProcess.peg.reg ___________________________________________________________________ Added: svn:mergeinfo + Modified: pybase/trunk/omc-pybase-providers.spec =================================================================== --- pybase/trunk/omc-pybase-providers.spec 2008-09-27 00:20:05 UTC (rev 1042) +++ pybase/trunk/omc-pybase-providers.spec 2008-09-27 00:23:10 UTC (rev 1043) @@ -62,17 +62,17 @@ %pre if [ $1 -gt 1 ]; then peg-loadmof.sh -r -n root/cimv2 /usr/share/mof/%{name}/OMC_Base.mof - peg-loadmof.sh -r -n root/PG_InterOp /usr/share/mof/%{name}/*-peg.reg + peg-loadmof.sh -r -n root/PG_InterOp /usr/share/mof/%{name}/*.peg.reg fi %post -peg-loadmof.sh -n root/PG_InterOp /usr/share/mof/%{name}/*-peg.reg +peg-loadmof.sh -n root/PG_InterOp /usr/share/mof/%{name}/*.peg.reg peg-loadmof.sh -n root/cimv2 /usr/share/mof/%{name}/OMC_Base.mof %preun if [ "$1" = "0" -a -x /usr/bin/peg-loadmof.sh ] ; then # last uninstall, not upgrade - peg-loadmof.sh -r -n root/PG_InterOp /usr/share/mof/%{name}/*-peg.reg + peg-loadmof.sh -r -n root/PG_InterOp /usr/share/mof/%{name}/*.peg.reg peg-loadmof.sh -r -n root/cimv2 /usr/share/mof/%{name}/OMC_Base.mof fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-27 00:20:12
|
Revision: 1042 http://omc.svn.sourceforge.net/omc/?rev=1042&view=rev Author: bartw Date: 2008-09-27 00:20:05 +0000 (Sat, 27 Sep 2008) Log Message: ----------- small fix Modified Paths: -------------- pybase/trunk/OMC_ComputerSystem.py Modified: pybase/trunk/OMC_ComputerSystem.py =================================================================== --- pybase/trunk/OMC_ComputerSystem.py 2008-09-26 00:02:44 UTC (rev 1041) +++ pybase/trunk/OMC_ComputerSystem.py 2008-09-27 00:20:05 UTC (rev 1042) @@ -46,28 +46,6 @@ """ def get_instance(self, env, model): - """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()' \ @@ -104,29 +82,7 @@ return model def enum_instances(self, env, model, 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__) @@ -140,41 +96,14 @@ yield model else: try: - yield self.get_instance(env, model, cim_class) + yield self.get_instance(env, model) 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, modify_existing): - """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__) @@ -183,27 +112,7 @@ 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__) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mik...@us...> - 2008-09-26 00:02:55
|
Revision: 1041 http://omc.svn.sourceforge.net/omc/?rev=1041&view=rev Author: mike-brasher Date: 2008-09-26 00:02:44 +0000 (Fri, 26 Sep 2008) Log Message: ----------- Reworked methods in CMPIBroker to throw exceptions on errors. Modified Paths: -------------- cmpi-bindings/trunk/swig/cmpi.i cmpi-bindings/trunk/swig/cmpi_callbacks.i cmpi-bindings/trunk/test/python/TestMethod.py Modified: cmpi-bindings/trunk/swig/cmpi.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi.i 2008-09-24 17:38:46 UTC (rev 1040) +++ cmpi-bindings/trunk/swig/cmpi.i 2008-09-26 00:02:44 UTC (rev 1041) @@ -118,6 +118,16 @@ #include "../src/cmpi_provider_python.c" #endif +/* RAISE exception IF status argument has a nonzero rc member */ +#define RAISE_IF(ST) \ + do \ + { \ + CMPIStatus __st__ = (ST); \ + if (__st__.rc) \ + _raise_ex(&__st__); \ + } \ + while (0) + %} %exceptionclass CMPIException; Modified: cmpi-bindings/trunk/swig/cmpi_callbacks.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-09-24 17:38:46 UTC (rev 1040) +++ cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-09-26 00:02:44 UTC (rev 1041) @@ -7,120 +7,333 @@ %rename(CMPIBroker) CMPIBroker; typedef struct _CMPIBroker {} CMPIBroker; -%extend CMPIBroker { - void LogMessage(int severity, const char *id, const char *text) { - CMLogMessage($self, severity, id, text, NULL); +%extend CMPIBroker +{ + void LogMessage( + int severity, + const char *id, + const char *text) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + + CMLogMessage($self, severity, id, text, &st); + RAISE_IF(st); } - unsigned long capabilities() { + + unsigned long capabilities() + { return CBGetCapabilities($self); } - int version() { + + int version() + { return CBBrokerVersion($self); } - const char *name() { + + const char *name() + { return CBBrokerName($self); } - CMPIBoolean classPathIsA(const CMPIObjectPath *op, const char *parent_class) { + + CMPIBoolean classPathIsA( + const CMPIObjectPath *op, + const char *parent_class) + { return CMClassPathIsA($self, op, parent_class, NULL); } - CMPIStatus deliverIndication(const CMPIContext * ctx, const char * ns, const CMPIInstance * ind) { - return CBDeliverIndication($self, ctx, ns, ind); + + void deliverIndication( + const CMPIContext * ctx, + const char * ns, + const CMPIInstance * ind) + { + RAISE_IF(CBDeliverIndication($self, ctx, ns, ind)); } - CMPIEnumeration* enumInstanceNames(const CMPIContext * ctx, const CMPIObjectPath * op) { - CMPIStatus st; + + CMPIEnumeration* enumInstanceNames( + const CMPIContext * ctx, + const CMPIObjectPath * op) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; CMPIEnumeration* e; e = CBEnumInstanceNames($self, ctx, op, &st); + RAISE_IF(st); - if (st.rc) - _raise_ex(&st); - return e; } - CMPIEnumeration *enumInstances(const CMPIContext * ctx, const CMPIObjectPath * op, const char **properties) { - return CBEnumInstances($self, ctx, op, properties, NULL); + + CMPIEnumeration *enumInstances( + const CMPIContext * ctx, + const CMPIObjectPath * op, const char **properties) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIEnumeration* result; + + result = CBEnumInstances($self, ctx, op, properties, &st); + RAISE_IF(st); + + return result; } - CMPIInstance *getInstance(const CMPIContext * ctx, const CMPIObjectPath * op, const char **properties) { - return CBGetInstance($self, ctx, op, properties, NULL); + + CMPIInstance *getInstance( + const CMPIContext * ctx, + const CMPIObjectPath * op, + const char **properties) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIInstance* result; + + result = CBGetInstance($self, ctx, op, properties, &st); + RAISE_IF(st); + + return result; } - CMPIObjectPath *createInstance(const CMPIContext * ctx, const CMPIObjectPath * op, const CMPIInstance * inst) { - return CBCreateInstance($self, ctx, op, inst, NULL); + + CMPIObjectPath *createInstance( + const CMPIContext * ctx, + const CMPIObjectPath * op, + const CMPIInstance * inst) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIObjectPath* result; + + result = CBCreateInstance($self, ctx, op, inst, &st); + RAISE_IF(st); + + return result; } + /* CMPIStatus setInstance(const CMPIContext* ctx, const CMPIObjectPath* op, const CMPIInstance* inst, const char** properties) { return CBSetInstance($self, ctx, op, inst, properties); } */ - CMPIStatus deleteInstance(const CMPIContext * ctx, const CMPIObjectPath * op) { - return CBDeleteInstance($self, ctx, op); + + void deleteInstance( + const CMPIContext * ctx, + const CMPIObjectPath * op) + { + RAISE_IF(CBDeleteInstance($self, ctx, op)); } - CMPIEnumeration *execQuery(const CMPIContext * ctx, const CMPIObjectPath * op, const char *query, const char *lang) { - return CBExecQuery($self, ctx, op, query, lang, NULL); + + CMPIEnumeration *execQuery( + const CMPIContext * ctx, + const CMPIObjectPath * op, + const char *query, + const char *lang) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIEnumeration* result; + + result = CBExecQuery($self, ctx, op, query, lang, &st); + RAISE_IF(st); + + return result; } - CMPIEnumeration *associators(const CMPIContext * ctx, const CMPIObjectPath * op, - const char *assocClass, const char *resultClass, const char *role, - const char *resultRole, const char **properties) { - return CBAssociators($self, ctx, op, assocClass, resultClass, role, resultRole, properties, NULL); + + CMPIEnumeration *associators( + const CMPIContext * ctx, + const CMPIObjectPath * op, + const char *assocClass, + const char *resultClass, + const char *role, + const char *resultRole, + const char **properties) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIEnumeration* result; + + result = CBAssociators($self, ctx, op, assocClass, resultClass, role, + resultRole, properties, &st); + RAISE_IF(st); + + return result; } - CMPIEnumeration *associatorNames(const CMPIContext * ctx, const CMPIObjectPath * op, - const char *assocClass, const char *resultClass, const char *role, - const char *resultRole) { - return CBAssociatorNames ($self, ctx, op, assocClass, resultClass, role, resultRole, NULL); + + CMPIEnumeration *associatorNames( + const CMPIContext * ctx, + const CMPIObjectPath * op, + const char *assocClass, + const char *resultClass, + const char *role, + const char *resultRole) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIEnumeration* result; + + result = CBAssociatorNames($self, ctx, op, assocClass, resultClass, role, + resultRole, &st); + RAISE_IF(st); + + return result; } - CMPIEnumeration *references(const CMPIContext * ctx, const CMPIObjectPath * op, - const char *resultClass, const char *role, const char **properties) { - return CBReferences($self, ctx, op, resultClass, role, properties, NULL); + + CMPIEnumeration *references( + const CMPIContext * ctx, + const CMPIObjectPath * op, + const char *resultClass, + const char *role, + const char **properties) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIEnumeration* result; + + result = CBReferences($self, ctx, op, resultClass, role, properties, &st); + RAISE_IF(st); + + return result; } - CMPIEnumeration *referenceNames(const CMPIContext * ctx, const CMPIObjectPath * op, - const char *resultClass, const char *role) { - return CBReferenceNames($self, ctx, op, resultClass, role, NULL); + + CMPIEnumeration *referenceNames( + const CMPIContext * ctx, + const CMPIObjectPath * op, + const char *resultClass, + const char *role) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIEnumeration* result; + + result = CBReferenceNames($self, ctx, op, resultClass, role, &st); + RAISE_IF(st); + + return result; } - CMPIData invokeMethod(const CMPIContext * ctx, const CMPIObjectPath * op, const char *method, - const CMPIArgs * in, CMPIArgs * out) { - return CBInvokeMethod($self, ctx, op, method, in, out, NULL); + + CMPIData invokeMethod( + const CMPIContext * ctx, + const CMPIObjectPath * op, + const char *method, + const CMPIArgs * in, + CMPIArgs * out) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIData result; + + result = CBInvokeMethod($self, ctx, op, method, in, out, &st); + RAISE_IF(st); + + return result; } - CMPIStatus setProperty(const CMPIContext * ctx, const CMPIObjectPath * op, const char *name, - const CMPIValue * value, const CMPIType type) { - return CBSetProperty($self, ctx, op, name, (CMPIValue *)value, type); + + void setProperty( + const CMPIContext * ctx, + const CMPIObjectPath * op, + const char *name, + const CMPIValue * value, + const CMPIType type) + { + RAISE_IF(CBSetProperty($self, ctx, op, name, (CMPIValue *)value, type)); } - CMPIData getProperty(const CMPIContext * ctx, const CMPIObjectPath *op, const char *name) { - return CBGetProperty($self, ctx, op, name, NULL); + + CMPIData getProperty( + const CMPIContext * ctx, + const CMPIObjectPath *op, + const char *name) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIData result; + + result = CBGetProperty($self, ctx, op, name, &st); + RAISE_IF(st); + + return result; } + CMPIObjectPath* new_object_path(const char* ns, const char* cname) { - return CMNewObjectPath($self, ns, cname, NULL); + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIObjectPath* result; + + result = CMNewObjectPath($self, ns, cname, &st); + RAISE_IF(st); + + return result; } + CMPIInstance* new_instance(const CMPIObjectPath* path) { - return CMNewInstance($self, path, NULL); + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIInstance* result; + + result = CMNewInstance($self, path, &st); + RAISE_IF(st); + + return result; } + CMPIArgs* new_args(void) { - return CMNewArgs($self, NULL); + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIArgs* result; + + result = CMNewArgs($self, &st); + RAISE_IF(st); + + return result; } - CMPIDateTime* new_datetime(void) { - return CMNewDateTime($self, NULL); + + CMPIDateTime* new_datetime(void) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIDateTime* result; + + result = CMNewDateTime($self, &st); + RAISE_IF(st); + + return result; } - /* bintime: Date/Time definition in binary format in microsecods - * starting since 00:00:00 GMT, Jan 1,1970. - * interval: Wenn true, defines Date/Time definition to be an interval value - */ - CMPIDateTime* new_datetime_from_uint64(uint64_t bintime, int interval = 0 ) { - return CMNewDateTimeFromBinary($self, bintime, interval, NULL); + + CMPIDateTime* new_datetime_from_uint64( + uint64_t bintime, + int interval = 0 ) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIDateTime* result; + + result = CMNewDateTimeFromBinary($self, bintime, interval, &st); + RAISE_IF(st); + + return result; } + /* utc Date/Time definition in UTC format */ - CMPIDateTime* new_datetime_from_string(const char *utc) { - return CMNewDateTimeFromChars($self, utc, NULL); + CMPIDateTime* new_datetime_from_string(const char *utc) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIDateTime* result; + + result = CMNewDateTimeFromChars($self, utc, &st); + RAISE_IF(st); + + return result; } - CMPIString* new_string(const char *s) { - return CMNewString($self, s, NULL); + + CMPIString* new_string(const char *s) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIStatus* result; + + result = CMNewString($self, s, &st); + RAISE_IF(st); + + return result; } + /* count: Maximum number of elements * type: Element type */ - CMPIArray* new_array(int count, CMPIType type ) { - return CMNewArray( $self, count, type, NULL); + CMPIArray* new_array(int count, CMPIType type ) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIArray* result; + + result = CMNewArray($self, count, type, &st); + + RAISE_IF(st); + return result; } + #----------------------------------------------------- # # TODO: CMPIMsgFileHandle stuff @@ -130,10 +343,20 @@ * lang: The query language. * projection [Output]: Projection specification (suppressed when NULL). */ - CMPISelectExp* new_select_exp(const char *query, const char *lang, - CMPIArray **projection) { - return CMNewSelectExp($self, query, lang, projection, NULL); + CMPISelectExp* new_select_exp( + const char *query, + const char *lang, + CMPIArray **projection) + { + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPISelectExp* result; + + return CMNewSelectExp($self, query, lang, projection, &st); + RAISE_IF(st); + + return result; } + /* Create a new CMPIError object. * owner: Identifies the entity that owns the msg format definition. * msgID: Identifies the format of the message. @@ -142,12 +365,22 @@ * pc: Probable caues of this error. * cimStatusCodeStatus: Code. */ - CMPIError* new_error(const char *owner, const char* msgID, const char* msg, - const CMPIErrorSeverity sev, const CMPIErrorProbableCause pc, - const CMPIrc cimStatusCode) + CMPIError* new_error( + const char *owner, + const char* msgID, + const char* msg, + const CMPIErrorSeverity sev, + const CMPIErrorProbableCause pc, + const CMPIrc cimStatusCode) { - return CMNewCMPIError($self, owner, msgID, msg, sev, pc, - cimStatusCode, NULL); + CMPIStatus st = { CMPI_RC_OK, NULL }; + CMPIError* result; + + result = CMNewCMPIError($self, owner, msgID, msg, sev, pc, cimStatusCode, + &st); + RAISE_IF(st); + + return result; } void bummer() Modified: cmpi-bindings/trunk/test/python/TestMethod.py =================================================================== --- cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-24 17:38:46 UTC (rev 1040) +++ cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-26 00:02:44 UTC (rev 1041) @@ -44,15 +44,17 @@ logger.log_debug('Entering %s.enum_instances()' \ % self.__class__.__name__) - ''' + #''' ch = env.get_cimom_handle() try: - e = ch.EnumerateInstanceNames("root/cimv2", "TestAssoc_User") + e = ch.EnumerateInstanceNames("root/cimv2", "TestAssoc_Userx") for i in e: print i except pywbem.CIMError, e: + print "ABCDEFG" print e - ''' + print "HIJKLMNOP" + #''' ''' ch = env.get_cimom_handle() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-24 17:38:57
|
Revision: 1040 http://omc.svn.sourceforge.net/omc/?rev=1040&view=rev Author: bartw Date: 2008-09-24 17:38:46 +0000 (Wed, 24 Sep 2008) Log Message: ----------- removed incorrect comment Modified Paths: -------------- cmpi-bindings/trunk/swig/python/CMakeLists.txt Modified: cmpi-bindings/trunk/swig/python/CMakeLists.txt =================================================================== --- cmpi-bindings/trunk/swig/python/CMakeLists.txt 2008-09-24 04:06:45 UTC (rev 1039) +++ cmpi-bindings/trunk/swig/python/CMakeLists.txt 2008-09-24 17:38:46 UTC (rev 1040) @@ -53,7 +53,6 @@ INSTALL(TARGETS ${NAME} LIBRARY DESTINATION ${CMPI_LIBRARY_DIR}) # .py: swig generated INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmpi.py DESTINATION ${PYTHON_LIB_DIR}/site-packages ) -#!! needs symlink ${PYTHON_LIB_DIR}/site-packages/_cmpi.so -> ${CMPI_LIBRARY_DIR}/lib${NAME}.so # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-24 04:06:54
|
Revision: 1039 http://omc.svn.sourceforge.net/omc/?rev=1039&view=rev Author: bartw Date: 2008-09-24 04:06:45 +0000 (Wed, 24 Sep 2008) Log Message: ----------- added support for CMPIContext Modified Paths: -------------- cmpi-bindings/trunk/swig/cmpi_types.i cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py cmpi-bindings/trunk/test/python/TestAtomProvider.py cmpi-bindings/trunk/test/python/TestMethod.py Modified: cmpi-bindings/trunk/swig/cmpi_types.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi_types.i 2008-09-23 22:16:28 UTC (rev 1038) +++ cmpi-bindings/trunk/swig/cmpi_types.i 2008-09-24 04:06:45 UTC (rev 1039) @@ -856,6 +856,47 @@ CMPIString *s = CDToString(broker, $self, NULL); return CMGetCharPtr(s); } + void add_entry(const char* name, const CMPIValue* data, + const CMPIType type) { + CMAddContextEntry($self, name, data, type); + } + + CMPIData get_entry(const char* name) { + return CMGetContextEntry($self, name, NULL); // TODO CMPIStatus exception handling + } + +#if defined (SWIGRUBY) + VALUE +#endif +#if defined (SWIGPYTHON) + PyObject* +#endif + get_entry_at( int index ) { + CMPIString *s = NULL; + CMPIData data = CMGetContextEntryAt( $self, index, &s, NULL ); + +#if defined (SWIGRUBY) + VALUE rbdata = SWIG_NewPointerObj((void*) clone_data(&data), SWIGTYPE_p__CMPIData, 0); + VALUE rl = rb_ary_new2(2); + return rb_ary_push( rb_ary_push( rl, rbdata ), rb_str_new2(CMGetCharPtr(s) ) ); +#endif +#if defined (SWIGPYTHON) + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyObject* pydata = SWIG_NewPointerObj((void*) clone_data(&data), SWIGTYPE_p__CMPIData, 1); + + PyObject* pl = PyTuple_New(2); + PyTuple_SetItem(pl, 0, pydata); + PyTuple_SetItem(pl, 1, PyString_FromString(CMGetCharPtr(s))); + SWIG_PYTHON_THREAD_END_BLOCK; + return pl; +#endif + } + + CMPICount get_entry_count(void) { + return CMGetContextEntryCount($self, NULL); + // TODO CMPIStatus exception handling + } + } #----------------------------------------------------- Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-23 22:16:28 UTC (rev 1038) +++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-24 04:06:45 UTC (rev 1039) @@ -110,6 +110,80 @@ ## ##============================================================================== +class ContextWrap(object): + def __init__(self, proxy, cmpicontext): + self.proxy = proxy + self.cmpicontext = cmpicontext + + def __getitem__(self, key): + data = self.cmpicontext.get_entry(key) + _type, is_array = _cmpi_type2string(data.type) + return self.proxy.cmpi2pywbem_data(data, _type, is_array) + + def __setitem__(self, key, pval): + data, _type = self.proxy.pywbem2cmpi_value(pval) + ctype = _pywbem2cmpi_typemap[_type] + if isinstance(pval, list): + ctype = ctype | cmpi.CMPI_ARRAY + self.cmpicontext.add_entry(str(key), data, ctype) + + def __len__(self): + return self.cmpicontext.get_entry_count() + + def __repr__(self): + return `self.todict()` + + def keys(self): + return self.todict().keys() + + def items(self): + return self.todict().items() + + def values(self): + return self.todict().values() + + def __contains__(self, key): + return key in self.todict() + + def has_key(self, key): + return self.todict().has_key(key) + + def iterkeys(self): + return self.todict().iterkeys() + + def itervalues(self): + return self.todict().itervalues() + + def iteritems(self): + return self.todict().iteritems() + + def update(self, *args, **kwargs): + for mapping in args: + if hasattr(mapping, 'items'): + for k, v in mapping.items(): + self[k] = v + else: + for (k, v) in mapping: + self[k] = v + for k, v in kwargs.items(): + self[k] = v + + def get(self, key, default = None): + try: + return self.todict()[key] + except KeyError: + return default + + def todict(self): + d = {} + for i in xrange(0, self.cmpicontext.get_entry_count()): + data, name = self.cmpicontext.get_entry_at(i) + _type, is_array = _cmpi_type2string(data.type) + pval = self.proxy.cmpi2pywbem_data(data, _type, is_array) + d[name] = pval + return d + + class BrokerCIMOMHandle(object): def __init__(self, proxy, ctx): #self.broker = proxy.broker @@ -271,11 +345,11 @@ class ProviderEnvironment(object): def __init__(self, proxy, ctx): self.proxy = proxy - self.ctx = ctx + self.ctx = ContextWrap(proxy, ctx) def get_logger(self): return Logger(self.proxy.broker) def get_cimom_handle(self): - return BrokerCIMOMHandle(self.proxy, self.ctx) + return BrokerCIMOMHandle(self.proxy, self.ctx.cmpicontext) def get_user_name(self): pass def get_context_value(self, key): @@ -552,6 +626,8 @@ return (0, '') + # conversion routines + ####################################################################### def cmpi2pywbem_inst(self, cmpiinst): cop = self.cmpi2pywbem_instname(cmpiinst.objectpath()) Modified: cmpi-bindings/trunk/test/python/TestAtomProvider.py =================================================================== --- cmpi-bindings/trunk/test/python/TestAtomProvider.py 2008-09-23 22:16:28 UTC (rev 1038) +++ cmpi-bindings/trunk/test/python/TestAtomProvider.py 2008-09-24 04:06:45 UTC (rev 1039) @@ -20,6 +20,8 @@ % (self.__class__.__name__, __file__)) self.storage = {} + + def get_instance(self, env, model): """Return an instance. @@ -96,6 +98,36 @@ #for atom in self.storage.keys(): #print "Key = %s " %str(atom) + ## Test context + if not isinstance(env.ctx['CMPIInvocationFlags'], pywbem.Uint32): + raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, + 'context is broken: ' + `env.ctx`) + + oldlen = len(env.ctx) + env.ctx['foo'] = 'bar' + if env.ctx['foo'] != 'bar': + raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, + 'context is broken: ' + `env.ctx`) + + if oldlen + 1 != len(env.ctx): + raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, + 'context is broken: ' + `env.ctx`) + + if not 'foo' in env.ctx: + raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, + 'context is broken: ' + `env.ctx`) + + if 'foobar' in env.ctx: + raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, + 'context is broken: ' + `env.ctx`) + + env.ctx.update(foobar='foobar') + if env.ctx['foobar'] != 'foobar': + raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, + 'context is broken: ' + `env.ctx`) + + ## end context tests + for key in self.storage.keys(): #print "***** HELLO ***** " #logger.log_debug("************ ENUM_INSTANCES ********") Modified: cmpi-bindings/trunk/test/python/TestMethod.py =================================================================== --- cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-23 22:16:28 UTC (rev 1038) +++ cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-24 04:06:45 UTC (rev 1039) @@ -63,6 +63,7 @@ print e ''' + for key in g_insts.keys(): model['id'] = key model.path['id'] = key This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-23 22:16:29
|
Revision: 1038 http://omc.svn.sourceforge.net/omc/?rev=1038&view=rev Author: bartw Date: 2008-09-23 22:16:28 +0000 (Tue, 23 Sep 2008) Log Message: ----------- removed a completed item Modified Paths: -------------- cmpi-bindings/trunk/TODO Modified: cmpi-bindings/trunk/TODO =================================================================== --- cmpi-bindings/trunk/TODO 2008-09-23 22:15:57 UTC (rev 1037) +++ cmpi-bindings/trunk/TODO 2008-09-23 22:16:28 UTC (rev 1038) @@ -19,7 +19,5 @@ Indication providers -Port omc/pybase and omc/pyprofiles to new interface. - Update docs on pywbem wiki, starting with quickstart guide. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-23 22:16:07
|
Revision: 1037 http://omc.svn.sourceforge.net/omc/?rev=1037&view=rev Author: bartw Date: 2008-09-23 22:15:57 +0000 (Tue, 23 Sep 2008) Log Message: ----------- mild refactor Modified Paths: -------------- cmpi-bindings/trunk/src/cmpi_provider_python.c cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py Modified: cmpi-bindings/trunk/src/cmpi_provider_python.c =================================================================== --- cmpi-bindings/trunk/src/cmpi_provider_python.c 2008-09-23 20:25:54 UTC (rev 1036) +++ cmpi-bindings/trunk/src/cmpi_provider_python.c 2008-09-23 22:15:57 UTC (rev 1037) @@ -284,7 +284,7 @@ SWIG_PYTHON_THREAD_BEGIN_BLOCK; PyObject* provclass = PyObject_GetAttrString(_PYPROVMOD, - "CMPIProxyProvider"); + "get_cmpi_proxy_provider"); if (provclass == NULL) { SWIG_PYTHON_THREAD_END_BLOCK; Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-23 20:25:54 UTC (rev 1036) +++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-23 22:15:57 UTC (rev 1037) @@ -110,9 +110,6 @@ ## ##============================================================================== -def SFCBUDSConnection(): - return pywbem.WBEMConnection('/tmp/sfcbHttpSocket') - class BrokerCIMOMHandle(object): def __init__(self, proxy, ctx): #self.broker = proxy.broker @@ -130,7 +127,11 @@ def EnumerateInstanceNames(self, ns, cn): cop = self.broker.new_object_path(ns, cn) e = self.broker.enumInstanceNames(self.ctx, cop) - return self._yield_instance_names(e) + while e and e.hasNext(): + data=e.next() + assert(data.type == cmpi.CMPI_ref) + piname=self.proxy.cmpi2pywbem_instname(data.value.ref) + yield piname def EnumerateInstances(self, ns, cn, props = None): cop = self.broker.new_object_path(ns, cn) @@ -273,8 +274,6 @@ self.ctx = ctx def get_logger(self): return Logger(self.proxy.broker) - #def get_cimom_handle(self): - # return SFCBUDSConnection() def get_cimom_handle(self): return BrokerCIMOMHandle(self.proxy, self.ctx) def get_user_name(self): @@ -286,19 +285,19 @@ g_proxies = {} -def CMPIProxyProvider(miname, broker): +def get_cmpi_proxy_provider(miname, broker): try: prox = g_proxies[miname] if str(prox.proxy.env.proxy.broker) != str(broker): raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, 'New broker not the same as cached broker!') except KeyError: - prox = CMPIProxyProviderImpl(miname, broker) + prox = CMPIProxyProvider(miname, broker) g_proxies[miname] = prox return prox -class CMPIProxyProviderImpl(object): +class CMPIProxyProvider(object): def __init__(self, miname, broker): print 'called CMPIProxyProvider(', miname, ',', broker, ')' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-23 20:26:00
|
Revision: 1036 http://omc.svn.sourceforge.net/omc/?rev=1036&view=rev Author: bartw Date: 2008-09-23 20:25:54 +0000 (Tue, 23 Sep 2008) Log Message: ----------- added license text Modified Paths: -------------- pyprofiles/powerManagement/trunk/OMC_AssociatedPowerManagementService.py pyprofiles/powerManagement/trunk/OMC_HostedPowerManagementService.py pyprofiles/powerManagement/trunk/OMC_PowerManagementCapabilities.py pyprofiles/powerManagement/trunk/OMC_PowerManagementElementCapabilities.py pyprofiles/powerManagement/trunk/OMC_PowerManagementService.py Modified: pyprofiles/powerManagement/trunk/OMC_AssociatedPowerManagementService.py =================================================================== --- pyprofiles/powerManagement/trunk/OMC_AssociatedPowerManagementService.py 2008-09-23 20:25:16 UTC (rev 1035) +++ pyprofiles/powerManagement/trunk/OMC_AssociatedPowerManagementService.py 2008-09-23 20:25:54 UTC (rev 1036) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2008 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_AssociatedPowerManagementService Instruments the CIM class OMC_AssociatedPowerManagementService Modified: pyprofiles/powerManagement/trunk/OMC_HostedPowerManagementService.py =================================================================== --- pyprofiles/powerManagement/trunk/OMC_HostedPowerManagementService.py 2008-09-23 20:25:16 UTC (rev 1035) +++ pyprofiles/powerManagement/trunk/OMC_HostedPowerManagementService.py 2008-09-23 20:25:54 UTC (rev 1036) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2008 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_HostedPowerManagementService Instruments the CIM class OMC_HostedPowerManagementService Modified: pyprofiles/powerManagement/trunk/OMC_PowerManagementCapabilities.py =================================================================== --- pyprofiles/powerManagement/trunk/OMC_PowerManagementCapabilities.py 2008-09-23 20:25:16 UTC (rev 1035) +++ pyprofiles/powerManagement/trunk/OMC_PowerManagementCapabilities.py 2008-09-23 20:25:54 UTC (rev 1036) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2008 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_PowerManagementCapabilities Instruments the CIM class OMC_PowerManagementCapabilities Modified: pyprofiles/powerManagement/trunk/OMC_PowerManagementElementCapabilities.py =================================================================== --- pyprofiles/powerManagement/trunk/OMC_PowerManagementElementCapabilities.py 2008-09-23 20:25:16 UTC (rev 1035) +++ pyprofiles/powerManagement/trunk/OMC_PowerManagementElementCapabilities.py 2008-09-23 20:25:54 UTC (rev 1036) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2008 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_PowerManagementElementCapabilities Instruments the CIM class OMC_PowerManagementElementCapabilities Modified: pyprofiles/powerManagement/trunk/OMC_PowerManagementService.py =================================================================== --- pyprofiles/powerManagement/trunk/OMC_PowerManagementService.py 2008-09-23 20:25:16 UTC (rev 1035) +++ pyprofiles/powerManagement/trunk/OMC_PowerManagementService.py 2008-09-23 20:25:54 UTC (rev 1036) @@ -1,3 +1,33 @@ +#******************************************************************************* +# Copyright (C) 2008 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_PowerManagementService Instruments the CIM class OMC_PowerManagementService This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-23 20:25:19
|
Revision: 1035 http://omc.svn.sourceforge.net/omc/?rev=1035&view=rev Author: bartw Date: 2008-09-23 20:25:16 +0000 (Tue, 23 Sep 2008) Log Message: ----------- added license, fixed ref class Modified Paths: -------------- pyprofiles/powerManagement/trunk/OMC_PowerManagement.mof Modified: pyprofiles/powerManagement/trunk/OMC_PowerManagement.mof =================================================================== --- pyprofiles/powerManagement/trunk/OMC_PowerManagement.mof 2008-09-23 17:49:41 UTC (rev 1034) +++ pyprofiles/powerManagement/trunk/OMC_PowerManagement.mof 2008-09-23 20:25:16 UTC (rev 1035) @@ -1,3 +1,32 @@ +/******************************************************************************* + * Copyright (C) 2008 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. + ******************************************************************************/ class OMC_PowerManagementService : CIM_PowerManagementService { @@ -13,7 +42,7 @@ [override("ServiceProvided"), KEY] OMC_PowerManagementService REF ServiceProvided; [override("UserOfService"), KEY] - OMC_UnitaryComputerSystem REF UserOfService; + OMC_ComputerSystem REF UserOfService; }; [Association] @@ -22,7 +51,7 @@ [override("Dependent"), KEY] OMC_PowerManagementService REF Dependent; [override("Antededent"), KEY] - OMC_UnitaryComputerSystem REF Antecedent; + OMC_ComputerSystem REF Antecedent; }; [Association] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mik...@us...> - 2008-09-23 17:49:51
|
Revision: 1034 http://omc.svn.sourceforge.net/omc/?rev=1034&view=rev Author: mike-brasher Date: 2008-09-23 17:49:41 +0000 (Tue, 23 Sep 2008) Log Message: ----------- Renamed function and removed test function. Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-23 17:44:49 UTC (rev 1033) +++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-23 17:49:41 UTC (rev 1034) @@ -120,7 +120,7 @@ self.proxy = proxy self.ctx = ctx - def _EnumerateInstanceNamesYield(self, e): + def _yield_instance_names(self, e): while e and e.hasNext(): data=e.next() assert(data.type == cmpi.CMPI_ref) @@ -130,17 +130,8 @@ def EnumerateInstanceNames(self, ns, cn): cop = self.broker.new_object_path(ns, cn) e = self.broker.enumInstanceNames(self.ctx, cop) - return self._EnumerateInstanceNamesYield(e) + return self._yield_instance_names(e) - def EnumerateInstanceNamesOld(self, ns, cn): - cop = self.broker.new_object_path(ns, cn) - e = self.broker.enumInstanceNames(self.ctx, cop) - while e and e.hasNext(): - data=e.next() - assert(data.type == cmpi.CMPI_ref) - piname=self.proxy.cmpi2pywbem_instname(data.value.ref) - yield piname - def EnumerateInstances(self, ns, cn, props = None): cop = self.broker.new_object_path(ns, cn) e = self.broker.enumInstances(self.ctx, cop, props) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mik...@us...> - 2008-09-23 17:45:00
|
Revision: 1033 http://omc.svn.sourceforge.net/omc/?rev=1033&view=rev Author: mike-brasher Date: 2008-09-23 17:44:49 +0000 (Tue, 23 Sep 2008) Log Message: ----------- Broker EnumerateInstanceNames into 2 functions so that exception raising would work from first function. Modified Paths: -------------- cmpi-bindings/trunk/install.sh cmpi-bindings/trunk/swig/cmpi_callbacks.i cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py cmpi-bindings/trunk/test/python/TestMethod.py Modified: cmpi-bindings/trunk/install.sh =================================================================== --- cmpi-bindings/trunk/install.sh 2008-09-23 16:02:02 UTC (rev 1032) +++ cmpi-bindings/trunk/install.sh 2008-09-23 17:44:49 UTC (rev 1033) @@ -19,8 +19,11 @@ ## PKGS=/usr/lib64/python2.5/site-packages +echo "cp ./build/swig/python/cmpi.py $PKGS" cp ./build/swig/python/cmpi.py $PKGS +echo "cp ./swig/python/cim_provider.py $PKGS" cp ./swig/python/cim_provider.py $PKGS +echo "cp ./swig/python/cmpi_pywbem_bindings.py $PKGS" cp ./swig/python/cmpi_pywbem_bindings.py $PKGS ## Modified: cmpi-bindings/trunk/swig/cmpi_callbacks.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-09-23 16:02:02 UTC (rev 1032) +++ cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-09-23 17:44:49 UTC (rev 1033) @@ -27,7 +27,15 @@ return CBDeliverIndication($self, ctx, ns, ind); } CMPIEnumeration* enumInstanceNames(const CMPIContext * ctx, const CMPIObjectPath * op) { - return CBEnumInstanceNames($self, ctx, op, NULL); + CMPIStatus st; + CMPIEnumeration* e; + + e = CBEnumInstanceNames($self, ctx, op, &st); + + if (st.rc) + _raise_ex(&st); + + return e; } CMPIEnumeration *enumInstances(const CMPIContext * ctx, const CMPIObjectPath * op, const char **properties) { return CBEnumInstances($self, ctx, op, properties, NULL); Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-23 16:02:02 UTC (rev 1032) +++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-23 17:44:49 UTC (rev 1033) @@ -60,8 +60,9 @@ ## ## ExceptionMethodWrapper ## -## This class puts an exception catching block around a method. Instances -## are created by the ExceptionObjectWrapper defined below. +## This class puts an exception translation block around any method. This +## block catches a cmpi.CMPIException, converts it a pywbem.CIMError, and +## raises the new exception. ## ##============================================================================== @@ -78,24 +79,19 @@ ##============================================================================== ## -## ExceptionObjectWrapper +## ExceptionClassWrapper ## -## This class puts an exception catching block around all methods of any -## class. The block catches cmpi.CMPIException, translates it to a -## pywbem.CIMError, and raises it. The following creates wraps an instance -## of the "Gadget" class. -## +## This class puts an exception translation block around all methods of any +## class. It creates an ExceptionMethodWrapper to invoke each method. For +## example, the following snipett wraps an instance of the Gadget class. +## ## g = Gadget() -## w = ExceptionObjectWrapper(g) +## w = ExceptionClassWrapper(g) +## w.foo() # call g.foo() with exception translation block around it. ## -## And the following delegates the foo() method to the Gadget instance, -## while placing an exception catching block around it. -## -## w.foo() # call g.foo() with exception block around it. -## ##============================================================================== -class ExceptionObjectWrapper: +class ExceptionClassWrapper: def __init__(self, obj): self.obj = obj @@ -119,13 +115,26 @@ class BrokerCIMOMHandle(object): def __init__(self, proxy, ctx): - self.broker = ExceptionObjectWrapper(proxy.broker) + #self.broker = proxy.broker + self.broker = ExceptionClassWrapper(proxy.broker) self.proxy = proxy self.ctx = ctx + def _EnumerateInstanceNamesYield(self, e): + while e and e.hasNext(): + data=e.next() + assert(data.type == cmpi.CMPI_ref) + piname=self.proxy.cmpi2pywbem_instname(data.value.ref) + yield piname + def EnumerateInstanceNames(self, ns, cn): cop = self.broker.new_object_path(ns, cn) e = self.broker.enumInstanceNames(self.ctx, cop) + return self._EnumerateInstanceNamesYield(e) + + def EnumerateInstanceNamesOld(self, ns, cn): + cop = self.broker.new_object_path(ns, cn) + e = self.broker.enumInstanceNames(self.ctx, cop) while e and e.hasNext(): data=e.next() assert(data.type == cmpi.CMPI_ref) Modified: cmpi-bindings/trunk/test/python/TestMethod.py =================================================================== --- cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-23 16:02:02 UTC (rev 1032) +++ cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-23 17:44:49 UTC (rev 1033) @@ -45,20 +45,13 @@ % self.__class__.__name__) ''' - ch = env.get_cimom_handle2() - keys = { - 'CreationClassName':'Linux_EthernetPort', - 'DeviceID':'0011D8378654', - 'SystemCreationClassName':'Linux_ComputerSystem', - 'SystemName':'redbird.austin.rr.com' } - - path = pywbem.CIMInstanceName( - 'Linux_EthernetPort', - namespace='root/cimv2', - keybindings=keys); - - inst = ch.GetInstance(path); - print inst + ch = env.get_cimom_handle() + try: + e = ch.EnumerateInstanceNames("root/cimv2", "TestAssoc_User") + for i in e: + print i + except pywbem.CIMError, e: + print e ''' ''' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mik...@us...> - 2008-09-23 16:02:12
|
Revision: 1032 http://omc.svn.sourceforge.net/omc/?rev=1032&view=rev Author: mike-brasher Date: 2008-09-23 16:02:02 +0000 (Tue, 23 Sep 2008) Log Message: ----------- Implemented CMPIException to CIMError translation. Implemented ExceptionObjectWrapper (to put exception translation block around method calls of any class). Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py cmpi-bindings/trunk/test/python/TestMethod.py Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-23 00:12:25 UTC (rev 1031) +++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-23 16:02:02 UTC (rev 1032) @@ -36,14 +36,90 @@ from pywbem.cim_provider2 import ProviderProxy import pywbem +import types +##============================================================================== +## +## _exception_to_error() +## +## This function converts a cmpi.CMPIException to a pywbem.CIMError. +## +##============================================================================== +def _exception_to_error(ex): + + code = ex.get_error_code() + desc = ex.get_description() + + if code < 0 or code > 17: + code = pywbem.CIM_ERR_ERR_FAILED + + return pywbem.CIMError(code, desc) + +##============================================================================== +## +## ExceptionMethodWrapper +## +## This class puts an exception catching block around a method. Instances +## are created by the ExceptionObjectWrapper defined below. +## +##============================================================================== + +class ExceptionMethodWrapper: + + def __init__(self, meth): + self.meth = meth + + def __call__(self, *args, **kwds): + try: + return self.meth(*args, **kwds) + except cmpi.CMPIException,e: + raise _exception_to_error(e) + +##============================================================================== +## +## ExceptionObjectWrapper +## +## This class puts an exception catching block around all methods of any +## class. The block catches cmpi.CMPIException, translates it to a +## pywbem.CIMError, and raises it. The following creates wraps an instance +## of the "Gadget" class. +## +## g = Gadget() +## w = ExceptionObjectWrapper(g) +## +## And the following delegates the foo() method to the Gadget instance, +## while placing an exception catching block around it. +## +## w.foo() # call g.foo() with exception block around it. +## +##============================================================================== + +class ExceptionObjectWrapper: + + def __init__(self, obj): + self.obj = obj + + def __getattr__(self, name): + attr = getattr(self.obj, name) + + if type(attr) is types.MethodType: + return ExceptionMethodWrapper(attr) + else: + return attr + +##============================================================================== +## +## +## +##============================================================================== + def SFCBUDSConnection(): return pywbem.WBEMConnection('/tmp/sfcbHttpSocket') class BrokerCIMOMHandle(object): def __init__(self, proxy, ctx): - self.broker = proxy.broker + self.broker = ExceptionObjectWrapper(proxy.broker) self.proxy = proxy self.ctx = ctx @@ -176,10 +252,7 @@ return bool(self.broker.classPathIsA(subObjPath,super)) def bummer(self): - try: - self.broker.bummer() - except cmpi.CMPIException,e: - print "exception: %d:%s" %(e.get_error_code(), e.get_description()) + self.broker.bummer() class Logger(object): def __init__(self, broker): Modified: cmpi-bindings/trunk/test/python/TestMethod.py =================================================================== --- cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-23 00:12:25 UTC (rev 1031) +++ cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-23 16:02:02 UTC (rev 1032) @@ -63,7 +63,11 @@ ''' ch = env.get_cimom_handle() - ch.bummer() + + try: + ch.bummer() + except pywbem.CIMError, e: + print e ''' for key in g_insts.keys(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mik...@us...> - 2008-09-23 00:12:38
|
Revision: 1031 http://omc.svn.sourceforge.net/omc/?rev=1031&view=rev Author: mike-brasher Date: 2008-09-23 00:12:25 +0000 (Tue, 23 Sep 2008) Log Message: ----------- Rename raise_exception() to raise_ex() and change arguments to CMPIStatus object. Modified Paths: -------------- cmpi-bindings/trunk/swig/cmpi.i cmpi-bindings/trunk/swig/cmpi_callbacks.i cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py cmpi-bindings/trunk/test/python/TestMethod.py Modified: cmpi-bindings/trunk/swig/cmpi.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi.i 2008-09-22 23:53:09 UTC (rev 1030) +++ cmpi-bindings/trunk/swig/cmpi.i 2008-09-23 00:12:25 UTC (rev 1031) @@ -75,16 +75,24 @@ pthread_setspecific(_key, NULL); } -void raise_exception(int error_code, const char* description) +static void _raise_ex(const CMPIStatus* st) { #ifdef SWIGPYTHON PyObject* obj; CMPIException* ex; ex = (CMPIException*)malloc(sizeof(CMPIException)); - ex->error_code = error_code; - ex->description = strdup(description); + ex->error_code = st->rc; + const char* chars; + if (st->msg) + chars = CMGetCharsPtr(st->msg, NULL); + + if (chars) + ex->description = strdup(chars); + else + ex->description = NULL; + SWIG_PYTHON_THREAD_BEGIN_BLOCK; obj = SWIG_NewPointerObj(ex, SWIGTYPE_p__CMPIException, 1); PyErr_SetObject(SWIG_Python_ExceptionType(SWIGTYPE_p__CMPIException), obj); Modified: cmpi-bindings/trunk/swig/cmpi_callbacks.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-09-22 23:53:09 UTC (rev 1030) +++ cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-09-23 00:12:25 UTC (rev 1031) @@ -142,8 +142,13 @@ cimStatusCode, NULL); } - void oops() + void bummer() { - raise_exception(99, "oops"); + CMPIStatus st; + + CMSetStatusWithChars( + $self, &st, CMPI_RC_ERR_FAILED, "Bummer! I didn't see that coming"); + + _raise_ex(&st); } } Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-22 23:53:09 UTC (rev 1030) +++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-23 00:12:25 UTC (rev 1031) @@ -175,9 +175,9 @@ subObjPath=self.broker.new_object_path(ns, sub) return bool(self.broker.classPathIsA(subObjPath,super)) - def oops(self): + def bummer(self): try: - self.broker.oops() + self.broker.bummer() except cmpi.CMPIException,e: print "exception: %d:%s" %(e.get_error_code(), e.get_description()) Modified: cmpi-bindings/trunk/test/python/TestMethod.py =================================================================== --- cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-22 23:53:09 UTC (rev 1030) +++ cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-23 00:12:25 UTC (rev 1031) @@ -63,7 +63,7 @@ ''' ch = env.get_cimom_handle() - ch.oops() + ch.bummer() ''' for key in g_insts.keys(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mik...@us...> - 2008-09-22 23:53:18
|
Revision: 1030 http://omc.svn.sourceforge.net/omc/?rev=1030&view=rev Author: mike-brasher Date: 2008-09-22 23:53:09 +0000 (Mon, 22 Sep 2008) Log Message: ----------- Finished part I of CMPIStatus to CMPIException mapping (the C/SWIG side). Modified Paths: -------------- cmpi-bindings/trunk/install.sh cmpi-bindings/trunk/swig/cmpi.i cmpi-bindings/trunk/swig/cmpi_callbacks.i cmpi-bindings/trunk/swig/cmpi_types.i cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py cmpi-bindings/trunk/test/python/TestMethod.py Modified: cmpi-bindings/trunk/install.sh =================================================================== --- cmpi-bindings/trunk/install.sh 2008-09-22 23:08:28 UTC (rev 1029) +++ cmpi-bindings/trunk/install.sh 2008-09-22 23:53:09 UTC (rev 1030) @@ -43,5 +43,6 @@ fi if [ "$1" = "sfcb" ]; then + echo "cp $SO /usr/lib64/" cp $SO /usr/lib64/ fi Modified: cmpi-bindings/trunk/swig/cmpi.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi.i 2008-09-22 23:08:28 UTC (rev 1029) +++ cmpi-bindings/trunk/swig/cmpi.i 2008-09-22 23:53:09 UTC (rev 1030) @@ -1,6 +1,7 @@ %module cmpi %include "typemaps.i" +%include exception.i %{ #include <stdint.h> @@ -16,7 +17,22 @@ #include <pthread.h> -/* CMPIException */ +static CMPIData * +clone_data(const CMPIData *dp) +{ + CMPIData *data = (CMPIData *)calloc(1, sizeof(CMPIData)); + memcpy(data, dp, sizeof(CMPIData)); + return data; +} + +/* +**============================================================================== +** +** struct _CMPIException +** +**============================================================================== +*/ + struct _CMPIException { int error_code; @@ -25,50 +41,66 @@ typedef struct _CMPIException CMPIException; -static CMPIData * -clone_data(const CMPIData *dp) +/* +**============================================================================== +** +** raise_exception() and associated paraphernalia +** +**============================================================================== +*/ + +static pthread_once_t _once = PTHREAD_ONCE_INIT; +static pthread_key_t _key; + +static void _init_key() { - CMPIData *data = (CMPIData *)calloc(1, sizeof(CMPIData)); - memcpy(data, dp, sizeof(CMPIData)); - return data; + pthread_key_create(&_key, NULL); } -/* - * raise_exception() - */ - -pthread_once_t _once = PTHREAD_ONCE_INIT; - static void* _get_raised() { - return pthread_getspecific(_once); + pthread_once(&_once, _init_key); + return pthread_getspecific(_key); } static void _set_raised() { - static const char _data[] = "dummy string"; - pthread_setspecific(_once, (void*)_data); + pthread_once(&_once, _init_key); + pthread_setspecific(_key, (void*)1); } static void _clr_raised() { - pthread_setspecific(_once, NULL); + pthread_once(&_once, _init_key); + pthread_setspecific(_key, NULL); } void raise_exception(int error_code, const char* description) { - char buffer[1024]; - sprintf(buffer, "%d:%s", error_code, description); +#ifdef SWIGPYTHON + PyObject* obj; + CMPIException* ex; + + ex = (CMPIException*)malloc(sizeof(CMPIException)); + ex->error_code = error_code; + ex->description = strdup(description); SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(PyExc_RuntimeError, buffer); + obj = SWIG_NewPointerObj(ex, SWIGTYPE_p__CMPIException, 1); + PyErr_SetObject(SWIG_Python_ExceptionType(SWIGTYPE_p__CMPIException), obj); SWIG_PYTHON_THREAD_END_BLOCK; _set_raised(); +#endif /* SWIGPYTHON */ } /* - * provider code - */ +**============================================================================== +** +** raise_exception() +** provider code +** +**============================================================================== +*/ #if defined(SWIGRUBY) #include "../src/cmpi_provider_ruby.c" @@ -80,6 +112,9 @@ %} +%exceptionclass CMPIException; +%exceptionclass _CMPIException; + # Definitions %include "cmpi_defs.i" Modified: cmpi-bindings/trunk/swig/cmpi_callbacks.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-09-22 23:08:28 UTC (rev 1029) +++ cmpi-bindings/trunk/swig/cmpi_callbacks.i 2008-09-22 23:53:09 UTC (rev 1030) @@ -7,17 +7,6 @@ %rename(CMPIBroker) CMPIBroker; typedef struct _CMPIBroker {} CMPIBroker; -%exception { - _clr_raised(); - $action - if (_get_raised()) - { - _clr_raised(); - SWIG_PYTHON_THREAD_END_ALLOW; - SWIG_fail; - } -} - %extend CMPIBroker { void LogMessage(int severity, const char *id, const char *text) { CMLogMessage($self, severity, id, text, NULL); @@ -158,32 +147,3 @@ raise_exception(99, "oops"); } } - -#----------------------------------------------------- -# -# CMPIException -# - -%nodefault _CMPIException; -%rename(CMPIException) CMPIException; -typedef struct _CMPIException {} CMPIException; - -%extend CMPIException { - - CMPIException() { - return (CMPIException*)calloc(1, sizeof(CMPIException)); - } - - ~CMPIException() { - free($self->description); - } - - int error_code() { - return $self->error_code; - } - - const char* get_description() { - return $self->description; - } -} - Modified: cmpi-bindings/trunk/swig/cmpi_types.i =================================================================== --- cmpi-bindings/trunk/swig/cmpi_types.i 2008-09-22 23:08:28 UTC (rev 1029) +++ cmpi-bindings/trunk/swig/cmpi_types.i 2008-09-22 23:53:09 UTC (rev 1030) @@ -102,6 +102,54 @@ #----------------------------------------------------- # +# CMPIException +# +#----------------------------------------------------- + +%nodefault _CMPIException; +%rename(CMPIException) CMPIException; +typedef struct _CMPIException {} CMPIException; + +%extend CMPIException { + + CMPIException() { + return (CMPIException*)calloc(1, sizeof(CMPIException)); + } + + ~CMPIException() { + free($self->description); + } + + int get_error_code() { + return $self->error_code; + } + + const char* get_description() { + return $self->description; + } +} + +#----------------------------------------------------- +# +# %exception +# +#----------------------------------------------------- + +#ifdef SWIGPYTHON +%exception { + _clr_raised(); + $action + if (_get_raised()) + { + _clr_raised(); + SWIG_PYTHON_THREAD_END_ALLOW; + SWIG_fail; + } +} +#endif /* SWIGPYTHON */ + +#----------------------------------------------------- +# # CMPIError # @@ -261,7 +309,6 @@ } } - #----------------------------------------------------- # # CMPIObjectPath Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-22 23:08:28 UTC (rev 1029) +++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-09-22 23:53:09 UTC (rev 1030) @@ -176,7 +176,10 @@ return bool(self.broker.classPathIsA(subObjPath,super)) def oops(self): - self.broker.oops() + try: + self.broker.oops() + except cmpi.CMPIException,e: + print "exception: %d:%s" %(e.get_error_code(), e.get_description()) class Logger(object): def __init__(self, broker): Modified: cmpi-bindings/trunk/test/python/TestMethod.py =================================================================== --- cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-22 23:08:28 UTC (rev 1029) +++ cmpi-bindings/trunk/test/python/TestMethod.py 2008-09-22 23:53:09 UTC (rev 1030) @@ -63,14 +63,7 @@ ''' ch = env.get_cimom_handle() - print "BEFORE" - - try: - ch.oops() - except RuntimeError: - print "CAUGHT" - - print "AFTER" + ch.oops() ''' for key in g_insts.keys(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ba...@us...> - 2008-09-22 23:08:38
|
Revision: 1029 http://omc.svn.sourceforge.net/omc/?rev=1029&view=rev Author: bartw Date: 2008-09-22 23:08:28 +0000 (Mon, 22 Sep 2008) Log Message: ----------- refactored to support more power states Modified Paths: -------------- pyprofiles/powerManagement/trunk/OMC_AssociatedPowerManagementService.py pyprofiles/powerManagement/trunk/OMC_PowerManagementCapabilities.py pyprofiles/powerManagement/trunk/OMC_PowerManagementService.py Modified: pyprofiles/powerManagement/trunk/OMC_AssociatedPowerManagementService.py =================================================================== --- pyprofiles/powerManagement/trunk/OMC_AssociatedPowerManagementService.py 2008-09-22 19:54:28 UTC (rev 1028) +++ pyprofiles/powerManagement/trunk/OMC_AssociatedPowerManagementService.py 2008-09-22 23:08:28 UTC (rev 1029) @@ -12,6 +12,8 @@ import OMC_PowerManagementService get_service_path = OMC_PowerManagementService.get_path service_id = OMC_PowerManagementService.inst_id +script_file = OMC_PowerManagementService.script_file +script_pid = OMC_PowerManagementService.script_pid from socket import getfqdn @@ -19,27 +21,24 @@ def get_shutdown_time(): try: - fo = open('/var/run/shutdown.pid', 'r') + fo = open(script_pid, 'r') except IOError: return None spid = fo.read().strip() fo.close() lp = LinuxProcess(spid) - if lp.get_module_path() != '/sbin/shutdown': - return None - proc_start = lp.get_start_time() cmdline = lp.get_command_line() - if cmdline[-1][0] == '+': - targ = cmdline[-1] - elif cmdline[-2][0] == '+': - targ = cmdline[-2] - else: + if len(cmdline) < 3: return None - if targ[0] == '+': - minutes = int(targ[1:]) - ndt = proc_start.datetime + timedelta(minutes=minutes) - return pywbem.CIMDateTime(ndt) - return None + if cmdline[1] == script_file: + del cmdline[0] + if cmdline[0] != script_file: + return None + if len(cmdline) < 3: + return None + requested_state = pywbem.Uint16(cmdline[2]) + gotime = pywbem.CIMDateTime(cmdline[1]) + return (requested_state, gotime) @@ -69,11 +68,15 @@ #model['OtherPowerState'] = '' # TODO #model['OtherRequestedPowerState'] = '' # TODO - shutdowntime = get_shutdown_time() + rv = get_shutdown_time() + if rv is None: + shutdowntime = None + else: + shutdowntime = rv[1] model['PowerOnTime'] = pywbem.CIMProperty('PowerOnTime', value=shutdowntime, type='datetime') if shutdowntime is not None: - model['RequestedPowerState'] = self.Values.RequestedPowerState.Power_Cycle__Off___Soft_Graceful_ + model['RequestedPowerState'] = rv[0] else: model['RequestedPowerState'] = self.Values.RequestedPowerState.Not_Applicable model['PowerState'] = self.Values.PowerState.On Modified: pyprofiles/powerManagement/trunk/OMC_PowerManagementCapabilities.py =================================================================== --- pyprofiles/powerManagement/trunk/OMC_PowerManagementCapabilities.py 2008-09-22 19:54:28 UTC (rev 1028) +++ pyprofiles/powerManagement/trunk/OMC_PowerManagementCapabilities.py 2008-09-22 23:08:28 UTC (rev 1029) @@ -7,6 +7,8 @@ import pywbem from pywbem.cim_provider2 import CIMProvider2 +from OMC_PowerManagementService import get_supported_states + inst_id = 'SUSE:PowerManagementCapabilities' def get_path(mapping): @@ -47,14 +49,17 @@ #model['OtherPowerCapabilitiesDescriptions'] = ['',] # TODO #model['OtherPowerChangeCapabilities'] = '' # TODO #model['PowerCapabilities'] = [self.Values.PowerCapabilities.<VAL>,] # TODO - model['PowerChangeCapabilities'] = [ - self.Values.PowerChangeCapabilities.Graceful_Shutdown_Supported, - self.Values.PowerChangeCapabilities.Power_State_Settable, - ] - model['PowerStatesSupported'] = [ - self.Values.PowerStatesSupported.Off___Soft_Graceful, - self.Values.PowerStatesSupported.On, - ] + states = get_supported_states() + + caps = set([capvals.Power_State_Settable]) + + for state in states.keys(): + if state in cap_map: + caps.update(cap_map[state]) + + + model['PowerChangeCapabilities'] = list(caps) + model['PowerStatesSupported'] = states.keys() return model def enum_instances(self, env, model, keys_only): @@ -297,3 +302,20 @@ omc_powermanagementcapabilities_prov = OMC_PowerManagementCapabilitiesProvider(env) return {'OMC_PowerManagementCapabilities': omc_powermanagementcapabilities_prov} +capvals = OMC_PowerManagementCapabilitiesProvider.Values.PowerChangeCapabilities +psvals = OMC_PowerManagementCapabilitiesProvider.Values.PowerStatesSupported +cap_map = { +psvals.Power_Cycle__Off___Soft_:[capvals.Power_Cycling_Supported], +psvals.Power_Cycle__Off_Hard_ :[capvals.Off_Hard_Power_Cycling_Supported], +psvals.Master_Bus_Reset: [capvals.HW_Reset_Supported], +psvals.Diagnostic_Interrupt__NMI_:[capvals.HW_Reset_Supported], +psvals.Off___Soft_Graceful: [capvals.Graceful_Shutdown_Supported], +psvals.Off___Hard_Graceful: [capvals.Graceful_Shutdown_Supported], +psvals.Master_Bus_Reset_Graceful: [capvals.HW_Reset_Supported, + capvals.Graceful_Shutdown_Supported], +psvals.Power_Cycle__Off___Soft_Graceful_: [capvals.Power_Cycling_Supported, + capvals.Graceful_Shutdown_Supported], +psvals.Power_Cycle__Off___Hard_Graceful_:[capvals.Graceful_Shutdown_Supported, + capvals.Off_Hard_Power_Cycling_Supported], +} + Modified: pyprofiles/powerManagement/trunk/OMC_PowerManagementService.py =================================================================== --- pyprofiles/powerManagement/trunk/OMC_PowerManagementService.py 2008-09-22 19:54:28 UTC (rev 1028) +++ pyprofiles/powerManagement/trunk/OMC_PowerManagementService.py 2008-09-22 23:08:28 UTC (rev 1029) @@ -8,7 +8,8 @@ from pywbem.cim_provider2 import CIMProvider2 from datetime import datetime, timedelta -from subprocess import call +from subprocess import Popen +import os from socket import getfqdn @@ -469,31 +470,53 @@ logger.log_debug('Entering %s.cim_method_requestpowerstatechange()' \ % self.__class__.__name__) + vals = self.Values.RequestPowerStateChange if param_timeoutperiod is not None and param_time is not None: - return (self.Values.RequestPowerStateChange.Unknown_or_Unspecified_Error,[]) + print 'RequestPowerStateChange() error: both TimeoutPeriod and Time parameters specified' + return (vals.Unknown_or_Unspecified_Error,[]) + if param_powerstate not in get_supported_states(): + print 'RequestPowerStateChange() error: attempt to change to unsupported state', param_powerstate + return (vals.Unknown_or_Unspecified_Error,[]) + + + tsecs = 0 + gotime = 0 if param_time is not None: if not isinstance(param_time, pywbem.CIMDateTime): - return (self.Values.RequestPowerStateChange.Invalid_Parameter,[]) + return (vals.Invalid_Parameter,[]) + now = pywbem.CIMDateTime.now().datetime if param_time.is_interval: td = param_time.timedelta + gotime = pywbem.CIMDateTime(now + td) + else: - now = pywbem.CIMDateTime.now().datetime + gotime = param_time if param_time.datetime < now: return (self.Values.RequestPowerStateChange.Invalid_Parameter,[]) td = param_time.datetime - now - tmins = td.days*24*60 + td.seconds / 60 \ - + td.microseconds / 10e6 / 60 - minutes = int(tmins) - if tmins % 1 >= 0.5: - minutes += 1 + tsecs = td.days*24*60*60 + td.seconds + td.microseconds / 10e5 - call('/sbin/shutdown -k -h +%s &' % minutes, shell=True) - return (self.Values.RequestPowerStateChange.Completed_with_No_Error,[]) + script = build_script(tsecs, param_powerstate) - rval = self.Values.RequestPowerStateChange.Unknown_or_Unspecified_Error - return (rval, out_params) + try: + fd = os.open(script_file, + os.O_WRONLY|os.O_CREAT|os.O_TRUNC, 0744) + except OSError, e: + raise pywbem.CIMError(pywbem.CIM_ERR_FAILED, str(e)) + + os.write(fd, script) + os.close(fd) + + pid = Popen(['/bin/sh', script_file, str(gotime), + str(param_powerstate)]).pid + fo = open(script_pid, 'w') + fo.write(str(pid)) + fo.close() + + return (self.Values.RequestPowerStateChange.Completed_with_No_Error,[]) + def cim_method_startservice(self, env, object_name): """Implements OMC_PowerManagementService.StartService() @@ -799,7 +822,66 @@ ## end of class OMC_PowerManagementServiceProvider +_vals = OMC_PowerManagementServiceProvider.Values.RequestPowerStateChange.PowerState + +shutdown_states = { + _vals.Power_Cycle__Off___Soft_Graceful_:'/sbin/shutdown -r now', + _vals.Power_Off___Soft_Graceful:'/sbin/shutdown -h now', + } + +sys_power_states = {} +try: + fo = open('/sys/power/state', 'r') + states = fo.read().split() + fo.close() + if 'standby' in states: + sys_power_states[_vals.Sleep___Light] = \ + 'echo -n "standby" > /sys/power/state' + if 'mem' in states: + sys_power_states[_vals.Sleep___Deep] = \ + 'echo -n "mem" > /sys/power/state' + if 'disk' in states: + sys_power_states[_vals.Hibernate] = \ + 'echo -n "disk" > /sys/power/state' +except IOError, e: + print 'Unable to open /sys/power/state:', e + +script_file = '/var/run/OMC_PowerManagementService_change_power_state.sh' +script_pid = script_file + '.pid' + + def get_providers(env): omc_powermanagementservice_prov = OMC_PowerManagementServiceProvider(env) return {'OMC_PowerManagementService': omc_powermanagementservice_prov} +def get_supported_states(): + states = {} + states.update(sys_power_states) + states.update(shutdown_states) + return states + + +def build_script(seconds, state): + script = '''#!/bin/sh\n +# This script was generated by %s + ''' % __file__ + + cmd = get_supported_states()[state] + + script+= '\nsleep %.3f' % seconds + script+= '\n' + cmd + '\n' + + return script + + + + + +if __name__ == '__main__': + import sys + seconds = int(sys.argv[1]) + state = pywbem.Uint16(sys.argv[2]) + print build_script(seconds, state) + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |