From: SourceForge.net <no...@so...> - 2005-04-27 18:55:00
|
Bugs item #1184528, was opened at 2005-04-17 04:56 Message generated for change (Comment added) made by bestorga-oss You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=712784&aid=1184528&group_id=128809 Category: Client Group: Function Status: Open Resolution: None Priority: 5 Submitted By: Gareth S Bestor (bestorga-oss) Assigned to: Viktor Mihajlovski (mihajlov) Summary: int key in client's reference object path turns into string Initial Comment: An integer key in the reference object path of a client command, eg the InstanceId=0 in [bestorga@bestorga bestorga]$ wbemcli gi 'http://localhost:5988/root/cimv2:TST_TestPropertyTypes.InstanceId=0,CreationClassName="TST_TestPropertyTypes"' appears to get translated into a string when it get passed into the provider method via the reference params; ie Instance="0" The client side command fails wbemcli gi 'http://localhost:5988/root/cimv2:TST_TestPropertyTypes.InstanceId=0,CreationClassName="TST_TestPropertyTypes"' * * wbemcli: Cim: (1) CIM_ERR_FAILED: Requested instance not found * because looking at the logging messages coming from the provider show: instanceTST_TestPropertyTypesProvider:GetInstance() called instanceTST_TestPropertyTypesProvider:GetInstance() Looking for object path: root/cimv2:TST_TestPropertyTypes.InstanceId="0",CreationClassName="TST_TestPropertyTypes" instanceTST_TestPropertyTypesProvider:GetInstance() Checking against object path: root/cimv2:TST_TestPropertyTypes.InstanceId=0,CreationClassName="TST_TestPropertyTypes" instanceTST_TestPropertyTypesProvider:GetInstance() Checking against object path: root/cimv2:TST_TestPropertyTypes.InstanceId=1,CreationClassName="TST_TestPropertyTypes" instanceTST_TestPropertyTypesProvider:GetInstance() Requested instance not found instanceTST_TestPropertyTypesProvider:GetInstance() failed The provider code for GetInstnace is: /* GetInstance() - return the instance data for the specified instance only */ static CMPIStatus GetInstance( CMPIInstanceMI * self, /* [in] Handle to this provider (i.e. 'self') */ CMPIContext * context, /* [in] Additional context info, if any */ CMPIResult * results, /* [out] Results of this operation */ CMPIObjectPath * reference, /* [in] Contains the CIM namespace, classname and desired object path */ char ** properties) /* [in] List of desired properties (NULL=all) */ { /* Commonly needed vars */ CMPIStatus status = {CMPI_RC_OK, NULL}; /* Return status of CIM operations */ CMPIInstance * instance; /* CIM instance of each new instance of this class */ CMPIObjectPath * objectpath; /* CIM object path of each new instance of this class */ int i; int found = 0; /* Was the desired reference object found? */ _OSBASE_TRACE(1,("%s:GetInstance() called", self->ft->miName)); _OSBASE_TRACE(1,("%s:GetInstance() Looking for object path: %s", self->ft->miName, CMGetCharPtr(CDToString(_BROKER,reference,NULL)) )); for (i=0; i<numinstances; i++) { instance = instances[i]; objectpath = CMGetObjectPath(instance,NULL); _OSBASE_TRACE(1,("%s:GetInstance() Checking against object path: %s", self->ft->miName, CMGetCharPtr(CDToString(_BROKER,objectpath,NULL)) )); if (_CMSameObject(objectpath, reference)) { found = 1; break; } } /* Check if found the desired instance */ if (found && !CMIsNullObject(instance)) { /* Return the found instance */ _OSBASE_TRACE(1,("%s:GetInstance() Found requested instance", self->ft->miName)); CMReturnInstance(results, instance); } else { _OSBASE_TRACE(1,("%s:GetInstance() Requested instance not found", self->ft->miName)); CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERR_FAILED, "Requested instance not found"); } /* Finished */ CMReturnDone(results); _OSBASE_TRACE(1,("%s:GetInstance() %s", self->ft->miName, (status.rc == CMPI_RC_OK)? "succeeded":"failed")); return status; } ---------------------------------------------------------------------- >Comment By: Gareth S Bestor (bestorga-oss) Date: 2005-04-27 18:54 Message: Logged In: YES user_id=1215486 it appears all keys are converted to strings by wbemcli [bestorga@bestorga bestorga]$ wbemcli -dx gi 'http://localhost:5988/root/cimv2:X.a="joe",b=13,c=true' To server: <?xml version="1.0" encoding="utf-8" ?> <CIM CIMVERSION="2.0" DTDVERSION="2.0"> <MESSAGE ID="4711" PROTOCOLVERSION="1.0"><SIMPLEREQ><IMETHODCALL NAME="GetInstance"><LOCALNAMESPACEPATH><NAMESPACE NAME="root"></NAMESPACE><NAMESPACE NAME="cimv2"></NAMESPACE></LOCALNAMESPACEPATH> <IPARAMVALUE NAME="LocalOnly"><VALUE>FALSE</VALUE></IPARAMVALUE> <IPARAMVALUE NAME="IncludeQualifiers"><VALUE>FALSE</VALUE></IPARAMVALUE> <IPARAMVALUE NAME="IncludeClassOrigin"><VALUE>TRUE</VALUE></IPARAMVALUE> <IPARAMVALUE NAME="InstanceName"><INSTANCENAME CLASSNAME="X"><KEYBINDING NAME="a"><KEYVALUE VALUETYPE="string">joe</KEYVALUE></KEYBINDING><KEYBINDING NAME="b"><KEYVALUE VALUETYPE="string">13</KEYVALUE></KEYBINDING><KEYBINDING NAME="c"><KEYVALUE VALUETYPE="string">true</KEYVALUE></KEYBINDING></INSTANCENAME></IPARAMVALUE> </IMETHODCALL></SIMPLEREQ> </MESSAGE></CIM> ---------------------------------------------------------------------- Comment By: Viktor Mihajlovski (mihajlov) Date: 2005-04-22 16:33 Message: Logged In: YES user_id=1198711 This is a shortcoming of wbemcli, it would have to issue a get class for each class...I have to think it over a bit...sigh ---------------------------------------------------------------------- Comment By: Gareth S Bestor (bestorga-oss) Date: 2005-04-17 05:00 Message: Logged In: YES user_id=1215486 OK. Problem seems to be coming from the client - wbemcli - converting InstanceId=0 to InstanceId="0" ; ie making this key value a string. [bestorga@bestorga bestorga]$ wbemcli -dx gi 'http://localhost:5988/root/cimv2:TST_TestPropertyTypes.InstanceId=0,CreationClassName="TST_TestPropertyTypes"' To server: <?xml version="1.0" encoding="utf-8" ?> <CIM CIMVERSION="2.0" DTDVERSION="2.0"> <MESSAGE ID="4711" PROTOCOLVERSION="1.0"><SIMPLEREQ><IMETHODCALL NAME="GetInstance"><LOCALNAMESPACEPATH><NAMESPACE NAME="root"></NAMESPACE><NAMESPACE NAME="cimv2"></NAMESPACE></LOCALNAMESPACEPATH> <IPARAMVALUE NAME="LocalOnly"><VALUE>FALSE</VALUE></IPARAMVALUE> <IPARAMVALUE NAME="IncludeQualifiers"><VALUE>FALSE</VALUE></IPARAMVALUE> <IPARAMVALUE NAME="IncludeClassOrigin"><VALUE>TRUE</VALUE></IPARAMVALUE> <IPARAMVALUE NAME="InstanceName"><INSTANCENAME CLASSNAME="TST_TestPropertyTypes"><KEYBINDING NAME="InstanceId"><KEYVALUE VALUETYPE="string">0</KEYVALUE></KEYBINDING><KEYBINDING NAME="CreationClassName"><KEYVALUE VALUETYPE="string">TST_TestPropertyTypes</KEYVALUE></KEYBINDING></INSTANCENAME></IPARAMVALUE> </IMETHODCALL></SIMPLEREQ> </MESSAGE></CIM> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=712784&aid=1184528&group_id=128809 |