You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(26) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(5) |
Feb
(16) |
Mar
(5) |
Apr
(5) |
May
(13) |
Jun
(12) |
Jul
(1) |
Aug
(2) |
Sep
(13) |
Oct
(6) |
Nov
(1) |
Dec
(29) |
| 2008 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
(57) |
May
(35) |
Jun
(45) |
Jul
(132) |
Aug
(87) |
Sep
(141) |
Oct
(86) |
Nov
(17) |
Dec
(2) |
| 2009 |
Jan
(3) |
Feb
(2) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
|
2
(13) |
3
(3) |
4
(3) |
5
(6) |
6
|
|
7
|
8
(2) |
9
(6) |
10
(15) |
11
(16) |
12
(6) |
13
(2) |
|
14
|
15
(11) |
16
(11) |
17
(5) |
18
(11) |
19
(1) |
20
(1) |
|
21
|
22
(3) |
23
(8) |
24
(2) |
25
|
26
(1) |
27
(4) |
|
28
(1) |
29
(7) |
30
(3) |
|
|
|
|
|
From: <kk...@us...> - 2008-09-30 12:58:04
|
Revision: 1056
http://omc.svn.sourceforge.net/omc/?rev=1056&view=rev
Author: kkaempf
Date: 2008-09-30 12:57:40 +0000 (Tue, 30 Sep 2008)
Log Message:
-----------
make target_python and target_ruby more similar
Modified Paths:
--------------
cmpi-bindings/trunk/CMakeLists.txt
cmpi-bindings/trunk/src/cmpi_provider.c
cmpi-bindings/trunk/src/target_python.c
cmpi-bindings/trunk/src/target_ruby.c
cmpi-bindings/trunk/swig/ruby/CMakeLists.txt
Added Paths:
-----------
cmpi-bindings/trunk/swig/ruby/cmpi_rbwbem_bindings.rb
Removed Paths:
-------------
cmpi-bindings/trunk/swig/ruby/rcmpi_instance.rb
Modified: cmpi-bindings/trunk/CMakeLists.txt
===================================================================
--- cmpi-bindings/trunk/CMakeLists.txt 2008-09-30 11:07:41 UTC (rev 1055)
+++ cmpi-bindings/trunk/CMakeLists.txt 2008-09-30 12:57:40 UTC (rev 1056)
@@ -35,7 +35,7 @@
INCLUDE(${CMAKE_SOURCE_DIR}/VERSION.cmake)
-SET(CMAKE_VERBOSE_MAKEFILE FALSE)
+SET(CMAKE_VERBOSE_MAKEFILE TRUE)
SET( PACKAGE "cmpi-bindings" )
SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
Modified: cmpi-bindings/trunk/src/cmpi_provider.c
===================================================================
--- cmpi-bindings/trunk/src/cmpi_provider.c 2008-09-30 11:07:41 UTC (rev 1055)
+++ cmpi-bindings/trunk/src/cmpi_provider.c 2008-09-30 12:57:40 UTC (rev 1056)
@@ -29,8 +29,10 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
+#include <sys/types.h>
#include <stdio.h>
#include <stdarg.h>
+#include <unistd.h>
#include <pthread.h>
/* Include the required CMPI macros, data types, and API function headers */
@@ -79,7 +81,7 @@
typedef struct __ProviderMIHandle
{
char *miName;
- Target_Type tgMod;
+ Target_Type instance;
const CMPIBroker* broker;
} ProviderMIHandle;
@@ -165,10 +167,23 @@
**==============================================================================
*/
-static int _MI_COUNT = 0;
+/*
+ * There is one target interpreter, serving multiple MIs
+ * The number of MIs using the interpreter is counted in _MI_COUNT,
+ * when the last user goes aways, the target interpreter is unloaded.
+ *
+ * _CMPI_INIT_MUTEX protects this references counter from concurrent access.
+ *
+ */
+
+static int _TARGET_INIT = 0; /* acts as a boolean - is target initialized? */
+static int _MI_COUNT = 0; /* use count, number of MIs */
+static pthread_mutex_t _CMPI_INIT_MUTEX = PTHREAD_MUTEX_INITIALIZER; /* mutex around _MI_COUNT */
+static Target_Type _TARGET_MODULE = Target_Null; /* The target module (aka namespace) */
+
/* on-demand init */
-#define TARGET_CMPI_INIT { if (((ProviderMIHandle*)(self->hdl))->tgMod == Target_Null) if (TargetInitialize(((ProviderMIHandle*)(self->hdl)), &status) != 0) return status; }
+#define TARGET_CMPI_INIT { if (((ProviderMIHandle*)(self->hdl))->instance == Target_Null) if (TargetInitialize(((ProviderMIHandle*)(self->hdl)), &status) != 0) return status; }
#if defined(SWIGPYTHON)
#include "target_python.c"
@@ -1095,7 +1110,7 @@
_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->instance = Target_Null; \
hdl->miName = strdup(miname); \
hdl->broker = broker; \
} \
Modified: cmpi-bindings/trunk/src/target_python.c
===================================================================
--- cmpi-bindings/trunk/src/target_python.c 2008-09-30 11:07:41 UTC (rev 1055)
+++ cmpi-bindings/trunk/src/target_python.c 2008-09-30 12:57:40 UTC (rev 1056)
@@ -11,17 +11,14 @@
static PyThreadState* cmpiMainPyThreadState = NULL;
-static int _PY_INIT = 0; // acts as a boolean - is target initialized?
-static Target_Type _PYPROVMOD = NULL;
-static pthread_mutex_t _CMPI_INIT_MUTEX = PTHREAD_MUTEX_INITIALIZER;
/*
- * print Python exception trace
+ * get Python exception trace -> CMPIString
*
*/
#define TB_ERROR(str) {tbstr = str; goto cleanup;}
-static CMPIString*
+static CMPIString *
get_exc_trace(const CMPIBroker* broker)
{
char *tbstr = NULL;
@@ -119,7 +116,9 @@
/*
* Global Python initializer
- * loads the Python interpreter
+ *
+ * load the Python interpreter
+ * import 'cmpi_pywbem_bindings' -> _TARGET_MODULE
* init threads
*/
@@ -128,12 +127,12 @@
{
_SBLIM_TRACE(1,("<%d/0x%x> PyGlobalInitialize() called", getpid(), pthread_self()));
- if (_PY_INIT)
+ if (_TARGET_INIT)
{
_SBLIM_TRACE(1,("<%d/0x%x> PyGlobalInitialize() returning: already initialized", getpid(), pthread_self()));
return 0;
}
- _PY_INIT=1;//true
+ _TARGET_INIT=1;//true
_SBLIM_TRACE(1,("<%d/0x%x> Python: Loading", getpid(), pthread_self()));
@@ -144,8 +143,13 @@
PyEval_ReleaseThread(cmpiMainPyThreadState);
TARGET_THREAD_BEGIN_BLOCK;
- _PYPROVMOD = PyImport_ImportModule("cmpi_pywbem_bindings");
- if (_PYPROVMOD == NULL)
+
+ /*
+ * import 'cmpi_pywbem_bindings'
+ */
+
+ _TARGET_MODULE = PyImport_ImportModule("cmpi_pywbem_bindings");
+ if (_TARGET_MODULE == NULL)
{
TARGET_THREAD_END_BLOCK;
_SBLIM_TRACE(1,("<%d/0x%x> Python: import cmpi_pywbem_bindings failed", getpid(), pthread_self()));
@@ -156,7 +160,7 @@
abort();
return -1;
}
- _SBLIM_TRACE(1,("<%d/0x%x> Python: _PYPROVMOD at %p", getpid(), pthread_self(), _PYPROVMOD));
+ _SBLIM_TRACE(1,("<%d/0x%x> Python: _TARGET_MODULE at %p", getpid(), pthread_self(), _TARGET_MODULE));
TARGET_THREAD_END_BLOCK;
_SBLIM_TRACE(1,("<%d/0x%x> PyGlobalInitialize() succeeded", getpid(), pthread_self()));
@@ -167,65 +171,6 @@
/*---------------------------------------------------------------*/
/*
- * local (per MI) Python initializer
- * keeps track of reference count
- */
-
-static int
-TargetInitialize(ProviderMIHandle* 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> TargetInitialize(Python) called", getpid(), pthread_self()));
-
- TARGET_THREAD_BEGIN_BLOCK;
- PyObject *provclass = PyObject_GetAttrString(_PYPROVMOD,
- "get_cmpi_proxy_provider");
- if (provclass == NULL)
- {
- TARGET_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> >>>>> TargetInitialize(Python) called, MINAME=%s\n",
- getpid(), pthread_self(), hdl->miName));
- PyTuple_SetItem(args, 0, string2target(hdl->miName));
- PyTuple_SetItem(args, 1, broker);
- PyObject *provinst = PyObject_CallObject(provclass, args);
- Py_DecRef(args);
- Py_DecRef(provclass);
- if (provinst == NULL)
- {
- TARGET_THREAD_END_BLOCK;
- _CMPI_SETFAIL(get_exc_trace(hdl->broker));
- return -1;
- }
-
- hdl->tgMod = provinst;
-
- TARGET_THREAD_END_BLOCK;
- _SBLIM_TRACE(1,("<%d/0x%x> TargetInitialize(Python) succeeded", getpid(), pthread_self()));
- return 0;
-}
-
-
-/*
* call_provider
*
*/
@@ -242,7 +187,7 @@
TARGET_THREAD_BEGIN_BLOCK;
pyargs = PyTuple_New(nargs);
- pyfunc = PyObject_GetAttrString(hdl->tgMod, opname);
+ pyfunc = PyObject_GetAttrString(hdl->instance, opname);
if (pyfunc == NULL)
{
PyErr_Print();
@@ -348,6 +293,70 @@
/*
+ * local (per MI) Python initializer
+ * keeps track of reference count
+ */
+
+static int
+TargetInitialize(ProviderMIHandle* 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();
+ }
+ /* import 'cmpi_pywbem_bindings' */
+ rc = PyGlobalInitialize(hdl->broker, st);
+ pthread_mutex_unlock(&_CMPI_INIT_MUTEX);
+ if (rc != 0)
+ {
+ return rc;
+ }
+
+ _SBLIM_TRACE(1,("<%d/0x%x> TargetInitialize(Python) called", getpid(), pthread_self()));
+
+ TARGET_THREAD_BEGIN_BLOCK;
+
+ /* cmpi_pywbem_bindings::get_cmpi_proxy_provider */
+ PyObject *provclass = PyObject_GetAttrString(_TARGET_MODULE,
+ "get_cmpi_proxy_provider");
+ if (provclass == NULL)
+ {
+ TARGET_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> >>>>> TargetInitialize(Python) called, MINAME=%s\n",
+ getpid(), pthread_self(), hdl->miName));
+ PyTuple_SetItem(args, 0, string2target(hdl->miName));
+ PyTuple_SetItem(args, 1, broker);
+
+ /* provinst = cmpi_pywbem_bindings::get_cmpi_proxy_provider( miName, broker ) */
+ PyObject *provinst = PyObject_CallObject(provclass, args);
+ Py_DecRef(args);
+ Py_DecRef(provclass);
+ if (provinst == NULL)
+ {
+ TARGET_THREAD_END_BLOCK;
+ _CMPI_SETFAIL(get_exc_trace(hdl->broker));
+ return -1;
+ }
+ /* save per-MI provider instance */
+ hdl->instance = provinst;
+
+ TARGET_THREAD_END_BLOCK;
+ _SBLIM_TRACE(1,("<%d/0x%x> TargetInitialize(Python) succeeded", getpid(), pthread_self()));
+ return 0;
+}
+
+
+/*
* TargetCleanup
*/
@@ -369,16 +378,16 @@
}
TARGET_THREAD_BEGIN_BLOCK;
- Py_DecRef(_PYPROVMOD);
+ Py_DecRef(_TARGET_MODULE);
TARGET_THREAD_END_BLOCK;
PyEval_AcquireLock();
PyThreadState_Swap(cmpiMainPyThreadState);
- if (_PY_INIT) // if PY is initialized and _MI_COUNT == 0, call Py_Finalize
+ if (_TARGET_INIT) // if Python is initialized and _MI_COUNT == 0, call Py_Finalize
{
_SBLIM_TRACE(1,("Calling Py_Finalize()"));
Py_Finalize();
- _PY_INIT=0; // false
+ _TARGET_INIT=0; // false
}
pthread_mutex_unlock(&_CMPI_INIT_MUTEX);
Modified: cmpi-bindings/trunk/src/target_ruby.c
===================================================================
--- cmpi-bindings/trunk/src/target_ruby.c 2008-09-30 11:07:41 UTC (rev 1055)
+++ cmpi-bindings/trunk/src/target_ruby.c 2008-09-30 12:57:40 UTC (rev 1056)
@@ -6,30 +6,92 @@
* Here: Ruby
*/
+/* load <RB_BINDINGS_FILE>.rb */
+#define RB_BINDINGS_FILE "cmpi_rbwbem_bindings"
+/* expect 'module <RB_BINDINGS_MODULE>' inside */
+#define RB_BINDINGS_MODULE "RbCmpi"
+
+/*
+ * load_module
+ * separate function for rb_require so it can be wrapped into rb_protect()
+ */
+
static VALUE
-load_code()
+load_module()
{
- _SBLIM_TRACE(1,("Ruby: require 'rcmpi_instance'..."));
-
- rb_require("rcmpi_instance");
+ _SBLIM_TRACE(1,("Ruby: require '%s'...", RB_BINDINGS_FILE));
- _SBLIM_TRACE(1,("Ruby: ... done"));
+ rb_require(RB_BINDINGS_FILE);
- return Qnil;
+ _SBLIM_TRACE(1,("Ruby: ... done"));
+
+ return Qnil;
}
+
+/*
+ * create_mi
+ * call constructor for MI implementation class
+ *
+ * I args : pointer to array of 2 values
+ * values[0] = broker, passed to constructor
+ * values[1] = id of class (rb_intern(<classname>))
+ */
+
static VALUE
-create_cmpi(VALUE args)
+create_mi(VALUE args)
{
- VALUE *values = (VALUE *)args;
- _SBLIM_TRACE(1,("Ruby: Cmpi_Instance.new ..."));
- VALUE klass = rb_class_new_instance(1, values, rb_const_get(rb_cObject, rb_intern("Cmpi_Instance")));
- _SBLIM_TRACE(1,("Ruby: ... done"));
- return klass;
+ VALUE *values = (VALUE *)args;
+ _SBLIM_TRACE(1,("Ruby: <MIclass>.new ..."));
+ VALUE klass = rb_class_new_instance(1, values, rb_const_get(_TARGET_MODULE, values[1]));
+ _SBLIM_TRACE(1,("Ruby: ... done"));
+ return klass;
}
+/*
+ * Global Ruby initializer
+ * loads the Ruby interpreter
+ * init threads
+ */
+
+static int
+RbGlobalInitialize(const CMPIBroker* broker, CMPIStatus* st)
+{
+ int error;
+
+ _SBLIM_TRACE(1,("<%d> RbGlobalInitialize() called", getpid()));
+
+ if (_TARGET_INIT)
+ {
+ _SBLIM_TRACE(1,("<%d> RbGlobalInitialize() returning: already initialized", getpid()));
+ return 0;
+ }
+ _TARGET_INIT=1;//true
+
+ _SBLIM_TRACE(1,("<%d> Ruby: Loading", getpid()));
+
+ ruby_init();
+ ruby_init_loadpath();
+ ruby_script("cmpi_swig");
+ SWIG_init();
+
+ /* load module */
+ rb_protect(load_module, Qnil, &error);
+ if (error)
+ {
+ _SBLIM_TRACE(1,("<%d> Ruby: import '%s' failed", getpid(), RB_BINDINGS_FILE));
+/* _CMPI_SETFAIL(<CMPIString *>); */
+ abort();
+ return -1;
+ }
+ _TARGET_MODULE = rb_intern(RB_BINDINGS_MODULE);
+ _SBLIM_TRACE(1,("<%d> RbGlobalInitialize() succeeded -> %ld", getpid(), _TARGET_MODULE));
+ return 0;
+}
+
+
/*---------------------------------------------------------------*/
/*
@@ -40,54 +102,45 @@
static int
TargetInitialize(ProviderMIHandle* hdl, CMPIStatus* st)
{
- int rc = 0;
- if (st != NULL)
- {
- st->rc = CMPI_RC_OK;
- st->msg = NULL;
- }
- int error = 0;
- VALUE cmpiInstance;
- SWIGEXPORT void SWIG_init(void);
-
- _SBLIM_TRACE(1,("Initialize() called"));
+ VALUE args[2];
+ int error;
- _SBLIM_TRACE(1,("Ruby: Loading"));
- ruby_init();
- ruby_init_loadpath();
- ruby_script("rcmpi_instance");
- SWIG_init();
+ /* Set _CMPI_INIT, protected by _CMPI_INIT_MUTEX
+ * so we call ruby_finalize() only once.
+ */
+ if (pthread_mutex_lock(&_CMPI_INIT_MUTEX))
+ {
+ perror("Can't lock _CMPI_INIT_MUTEX");
+ abort();
+ }
+ error = RbGlobalInitialize(hdl->broker, st);
+ pthread_mutex_unlock(&_CMPI_INIT_MUTEX);
+ if (error != 0)
+ {
+ goto exit;
+ }
- rb_protect(load_code, Qnil, &error);
- if (error) {
- _SBLIM_TRACE(1,("Ruby: FAILED loading rcmpi_instance.rb"));
- if (st != NULL)
- {
- st->rc = CMPI_RC_ERR_FAILED;
- }
- }
- else {
- _SBLIM_TRACE(1,("Ruby: loaded rcmpi_instance.rb"));
- VALUE args[1];
- args[0] = rb_str_new2(hdl->miName);
- cmpiInstance = rb_protect(create_cmpi, (VALUE)args, &error);
- if (error) {
- _SBLIM_TRACE(1,("Ruby: FAILED creating Cmpi"));
- if (st != NULL)
- {
- st->rc = CMPI_RC_ERR_FAILED;
- }
+ _SBLIM_TRACE(1,("<%d> TargetInitialize(Ruby) called", getpid()));
+
+ args[0] = SWIG_NewPointerObj((void*) hdl->broker, SWIGTYPE_p__CMPIBroker, 0);
+ args[1] = rb_str_new2(hdl->miName);
+ hdl->instance = rb_protect(create_mi, (VALUE)args, &error);
+ if (error)
+ {
+ _SBLIM_TRACE(1,("Ruby: FAILED creating %s", hdl->miName));
+ hdl->instance = Qnil;
+ if (st != NULL)
+ {
+ st->rc = CMPI_RC_ERR_FAILED;
}
- else {
- _SBLIM_TRACE(1,("Ruby: cmpi at %p", cmpiInstance));
- hdl->tgMod = cmpiInstance;
- }
}
-
- /* Finished. */
+ else
+ {
+ _SBLIM_TRACE(1,("Ruby: cmpi at %p", hdl->instance));
+ }
exit:
- _SBLIM_TRACE(1,("Initialize() %s", (rc == 0)? "succeeded":"failed"));
- return rc;
+ _SBLIM_TRACE(1,("Initialize() %s", (error == 0)? "succeeded":"failed"));
+ return error;
}
@@ -111,8 +164,8 @@
static void
TargetCleanup(void)
{
- ruby_finalize();
-
+ ruby_finalize();
+ _TARGET_MODULE = Qnil;
return;
}
Modified: cmpi-bindings/trunk/swig/ruby/CMakeLists.txt
===================================================================
--- cmpi-bindings/trunk/swig/ruby/CMakeLists.txt 2008-09-30 11:07:41 UTC (rev 1055)
+++ cmpi-bindings/trunk/swig/ruby/CMakeLists.txt 2008-09-30 12:57:40 UTC (rev 1056)
@@ -50,6 +50,6 @@
INSTALL(TARGETS ${NAME} LIBRARY DESTINATION ${CMPI_LIBRARY_DIR})
#
-# rcmpi_instance.rb: provider implementation
+# cmpi_rbwbem_bindings: provider implementation
#
-INSTALL(FILES rcmpi_instance.rb DESTINATION ${RUBY_LIB_DIR})
+INSTALL(FILES cmpi_rbwbem_bindings.rb DESTINATION ${RUBY_LIB_DIR})
Copied: cmpi-bindings/trunk/swig/ruby/cmpi_rbwbem_bindings.rb (from rev 1055, cmpi-bindings/trunk/swig/ruby/rcmpi_instance.rb)
===================================================================
--- cmpi-bindings/trunk/swig/ruby/cmpi_rbwbem_bindings.rb (rev 0)
+++ cmpi-bindings/trunk/swig/ruby/cmpi_rbwbem_bindings.rb 2008-09-30 12:57:40 UTC (rev 1056)
@@ -0,0 +1,55 @@
+#
+#
+#
+STDERR.puts "Hello, from rcmpi_instance.rb"
+
+require "pp"
+
+class Cmpi_Instance
+ def initialize name
+ STDERR.puts "Creating Cmpi_Instance #{name}"
+ end
+ def enum_instance_names context, results, reference
+ STDERR.puts "Running Cmpi_Instance:enum_instance_names"
+ begin
+ nm = reference.namespace
+ object_path = Cmpi::CMPIObjectPath.new nm
+
+ object_path["hello"] = "Hello,"
+ results.return_objectpath object_path
+
+ object_path["hello"] = "world!"
+ results.return_objectpath object_path
+
+ results.done
+ rescue Exception
+ STDERR.puts "Exception: #{$!.message}"
+ end
+ end
+ def enum_instances context, results, reference, properties
+ STDERR.puts "Running Cmpi_Instance:enum_instances"
+ begin
+# pp "Context #{context}"
+# pp "Result #{results}"
+# pp "Reference #{reference}"
+# pp "Properties #{properties}"
+
+ nm = reference.namespace
+ pp "nm #{nm}"
+
+ object_path = Cmpi::CMPIObjectPath.new nm
+
+ instance = Cmpi::CMPIInstance.new object_path
+ instance[:hello] = "Hello,"
+ results.return_instance instance
+
+ instance = Cmpi::CMPIInstance.new object_path
+ instance["hello"] = "world!"
+ results.return_instance instance
+
+ results.done
+ rescue Exception
+ STDERR.puts "Exception: #{$!.message}"
+ end
+ end
+end
Property changes on: cmpi-bindings/trunk/swig/ruby/cmpi_rbwbem_bindings.rb
___________________________________________________________________
Added: svn:mergeinfo
+
Deleted: cmpi-bindings/trunk/swig/ruby/rcmpi_instance.rb
===================================================================
--- cmpi-bindings/trunk/swig/ruby/rcmpi_instance.rb 2008-09-30 11:07:41 UTC (rev 1055)
+++ cmpi-bindings/trunk/swig/ruby/rcmpi_instance.rb 2008-09-30 12:57:40 UTC (rev 1056)
@@ -1,55 +0,0 @@
-#
-#
-#
-STDERR.puts "Hello, from rcmpi_instance.rb"
-
-require "pp"
-
-class Cmpi_Instance
- def initialize name
- STDERR.puts "Creating Cmpi_Instance #{name}"
- end
- def enum_instance_names context, results, reference
- STDERR.puts "Running Cmpi_Instance:enum_instance_names"
- begin
- nm = reference.namespace
- object_path = Cmpi::CMPIObjectPath.new nm
-
- object_path["hello"] = "Hello,"
- results.return_objectpath object_path
-
- object_path["hello"] = "world!"
- results.return_objectpath object_path
-
- results.done
- rescue Exception
- STDERR.puts "Exception: #{$!.message}"
- end
- end
- def enum_instances context, results, reference, properties
- STDERR.puts "Running Cmpi_Instance:enum_instances"
- begin
-# pp "Context #{context}"
-# pp "Result #{results}"
-# pp "Reference #{reference}"
-# pp "Properties #{properties}"
-
- nm = reference.namespace
- pp "nm #{nm}"
-
- object_path = Cmpi::CMPIObjectPath.new nm
-
- instance = Cmpi::CMPIInstance.new object_path
- instance[:hello] = "Hello,"
- results.return_instance instance
-
- instance = Cmpi::CMPIInstance.new object_path
- instance["hello"] = "world!"
- results.return_instance instance
-
- results.done
- rescue Exception
- STDERR.puts "Exception: #{$!.message}"
- end
- end
-end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kk...@us...> - 2008-09-30 11:07:53
|
Revision: 1055
http://omc.svn.sourceforge.net/omc/?rev=1055&view=rev
Author: kkaempf
Date: 2008-09-30 11:07:41 +0000 (Tue, 30 Sep 2008)
Log Message:
-----------
fix DESTDIR, $ENV must be escaped to \$ENV
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-30 00:51:56 UTC (rev 1054)
+++ cmpi-bindings/trunk/swig/python/CMakeLists.txt 2008-09-30 11:07:41 UTC (rev 1055)
@@ -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 $ENV{DESTDIR}${PYTHON_SITE_DIR}/cmpi.py $ENV{DESTDIR}${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: <ba...@us...> - 2008-09-30 00:52:03
|
Revision: 1054
http://omc.svn.sourceforge.net/omc/?rev=1054&view=rev
Author: bartw
Date: 2008-09-30 00:51:56 +0000 (Tue, 30 Sep 2008)
Log Message:
-----------
fixed _is_auto_start, used it to set EnabledDefault
Modified Paths:
--------------
pybase/trunk/OMC_InitdService.py
Modified: pybase/trunk/OMC_InitdService.py
===================================================================
--- pybase/trunk/OMC_InitdService.py 2008-09-29 22:56:32 UTC (rev 1053)
+++ pybase/trunk/OMC_InitdService.py 2008-09-30 00:51:56 UTC (rev 1054)
@@ -94,13 +94,23 @@
#------------------------------------------------------------------------------
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
+ fo = open('/etc/inittab', 'r')
+ for line in fo.xreadlines():
+ if line.startswith('id:'):
+ runlevel = line.split(':')[1]
+ fo.close()
+ break
+ else:
+ fo.close()
+ return False
+ ents = os.listdir('/etc/init.d/rc%s.d' % runlevel)
+ for ent in ents:
+ if ent.startswith('S') and ent[3:] == name:
+ return True
+ else:
+ return False
except:
+ print '**** Exception caught in _is_auto_start() !!'
pass
return False
@@ -125,7 +135,6 @@
% (self.__class__.__name__, model['name']))
#model['ElementName'] = # TODO (type = unicode)
- #model['EnabledDefault'] = # TODO (type = pywbem.Uint16 self.Values.EnabledDefault) (default=2L)
#model['EnabledState'] = # TODO (type = pywbem.Uint16 self.Values.EnabledState) (default=5L)
#model['HealthState'] = # TODO (type = pywbem.Uint16 self.Values.HealthState)
fullpath = '/etc/init.d/' + model['name']
@@ -164,7 +173,12 @@
if osts:
model['OperationalStatus'] = osts
- model['StartMode'] = _is_auto_start(model['name']) and 'Automatic' or 'Manual'
+ is_auto_start = _is_auto_start(model['name'])
+ model['StartMode'] = is_auto_start and 'Automatic' or 'Manual'
+ model['EnabledDefault'] = is_auto_start and \
+ self.Values.EnabledDefault.Enabled or \
+ self.Values.EnabledDefault.Disabled
+
svcStarted = (st == self.Values.ServiceStatus.Service_Running)
model['Started'] = svcStarted
#model['OperationalStatus'] = # TODO (type = [pywbem.Uint16,] self.Values.OperationalStatus)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|