From: Michael Chase-S. <mc...@us...> - 2011-11-23 20:56:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via d78ab371e7715e1520e226e28ad08891eb1ed414 (commit) via 66e6dde5b68669f78b19044b68bb7fc846d49802 (commit) from 10b508a77d4e2e0eb8a140962b1b77fdbc3db7a0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d78ab371e7715e1520e226e28ad08891eb1ed414 Author: Michael Chase-Salerno <br...@li...> Date: Wed Nov 23 15:55:58 2011 -0500 [ 3433733 ] CreationClassNames should be supplied commit 66e6dde5b68669f78b19044b68bb7fc846d49802 Author: Michael Chase-Salerno <br...@li...> Date: Wed Nov 23 15:54:04 2011 -0500 3433733 CreationClassNames should be supplied ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 63c1d5e..a1cdf03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-11-23 Michael Chase-Salerno <br...@li...> + + * interopProvider.c, indCIMXMLHandler.c, instance.c, instance.h: + [ 3433733 ] CreationClassNames should be supplied + 2011-11-22 Michael Chase-Salerno <br...@li...> * cimXmlParser.c, control.c, httpAdapter.c, sfcb.cfg.pre.in: diff --git a/indCIMXMLHandler.c b/indCIMXMLHandler.c index 8a06833..08d7daa 100644 --- a/indCIMXMLHandler.c +++ b/indCIMXMLHandler.c @@ -359,20 +359,7 @@ IndCIMXMLHandlerCreateInstance(CMPIInstanceMI * mi, CMPIObjectPath* copLocal = CMClone(cop, NULL); memLinkObjectPath(copLocal); - CMPIString *ccn = ciLocal->ft->getProperty(ciLocal, "creationclassname", - &st).value.string; - if (CMIsNullObject(ccn)) { - setStatus(&st, CMPI_RC_ERR_FAILED, - "CreationClassName property not found"); - _SFCB_RETURN(st); - } - CMPIString *sccn = ciLocal->ft->getProperty(ciLocal, "systemcreationclassname", - &st).value.string; - if (CMIsNullObject(sccn)) { - setStatus(&st, CMPI_RC_ERR_FAILED, - "SystemCreationClassName property not found"); - _SFCB_RETURN(st); - } + setCCN(copLocal,ciLocal,"CIM_ComputerSystem"); CMPIString *sysname=ciLocal->ft->getProperty(ciLocal,"SystemName",&st).value.string; if (sysname == NULL || sysname->hdl == NULL) { diff --git a/instance.c b/instance.c index 2ec61ed..a7a7748 100644 --- a/instance.c +++ b/instance.c @@ -1068,6 +1068,23 @@ instFillDefaultProperties(struct native_instance *inst, } #endif +/* + Set the CreationClassName and SystemCreationClassName + According to DSP1001, these need not be specified by the client + and should be ignored if provided. +*/ +void +setCCN(CMPIObjectPath * cop, + CMPIInstance *ci, + const char * sccn) +{ + CMPIString* ccn = CMGetClassName(cop, NULL); + CMAddKey(cop, "creationclassname", CMGetCharPtr(ccn), CMPI_chars); + CMSetProperty(ci,"creationclassname", CMGetCharPtr(ccn), CMPI_chars); + CMAddKey(cop, "systemcreationclassname", sccn, CMPI_chars); + CMSetProperty(ci,"systemcreationclassname", sccn, CMPI_chars); +} + /****************************************************************************/ /* MODELINES */ /* DO NOT EDIT BELOW THIS COMMENT */ diff --git a/instance.h b/instance.h index 1e56118..286b83d 100644 --- a/instance.h +++ b/instance.h @@ -25,6 +25,7 @@ int instanceCompare(CMPIInstance *inst1, CMPIInstance *inst2); const char *instGetClassName(CMPIInstance *ci); const char *instGetNameSpace(CMPIInstance *ci); CMPIStatus filterFlagProperty(CMPIInstance* ci, const char* id); +void setCCN(CMPIObjectPath * cop, CMPIInstance *ci, const char * sccn); #endif /* MODELINES */ diff --git a/interopProvider.c b/interopProvider.c index 1b2b0c9..8a16c82 100644 --- a/interopProvider.c +++ b/interopProvider.c @@ -950,22 +950,7 @@ InteropProviderCreateInstance(CMPIInstanceMI * mi, st = processSubscription(_broker, ctx, ciLocal, copLocal); } else if (isa(nss, cns, "cim_indicationfilter")) { - CMPIString *ccn = ciLocal->ft->getProperty(ciLocal, "creationclassname", - &st).value.string; - if (CMIsNullObject(ccn)) { - setStatus(&st, CMPI_RC_ERR_FAILED, - "CreationClassName property not found"); - _SFCB_RETURN(st); - } - CMPIString *sccn = ciLocal->ft->getProperty(ciLocal, "systemcreationclassname", - &st).value.string; - if (CMIsNullObject(sccn)) { - setStatus(&st, CMPI_RC_ERR_FAILED, - "SystemCreationClassName property not found"); - _SFCB_RETURN(st); - } - - + setCCN(copLocal,ciLocal,"CIM_ComputerSystem"); QLStatement *qs = NULL; int rc, i, diff --git a/test/TestProviders/tests/IndTest1CreateFilter.xml b/test/TestProviders/tests/IndTest1CreateFilter.xml index d994517..d8273d9 100644 --- a/test/TestProviders/tests/IndTest1CreateFilter.xml +++ b/test/TestProviders/tests/IndTest1CreateFilter.xml @@ -9,15 +9,16 @@ </LOCALNAMESPACEPATH> <IPARAMVALUE NAME="NewInstance"> <INSTANCE CLASSNAME="CIM_IndicationFilter"> - <PROPERTY NAME="SystemCreationClassName" TYPE="string"> - <VALUE>CIM_ComputerSystem</VALUE> - </PROPERTY> <PROPERTY NAME="SystemName" TYPE="string"> <VALUE>localhost.localdomain</VALUE> </PROPERTY> + <PROPERTY NAME="SystemCreationClassName" TYPE="string"> + <VALUE>CIM_ComputerSystem</VALUE> + </PROPERTY> <PROPERTY NAME="CreationClassName" TYPE="string"> <VALUE>CIM_IndicationFilter</VALUE> </PROPERTY> + <PROPERTY NAME="Name" TYPE="string"> <VALUE>Test_Indication_Filter_</VALUE> </PROPERTY> diff --git a/test/TestProviders/tests/IndTest2CreateHandler.xml b/test/TestProviders/tests/IndTest2CreateHandler.xml index 0fc1df7..a67dedd 100644 --- a/test/TestProviders/tests/IndTest2CreateHandler.xml +++ b/test/TestProviders/tests/IndTest2CreateHandler.xml @@ -9,15 +9,9 @@ </LOCALNAMESPACEPATH> <IPARAMVALUE NAME="NewInstance"> <INSTANCE CLASSNAME="CIM_IndicationHandlerCIMXML"> - <PROPERTY NAME="SystemCreationClassName" TYPE="string"> - <VALUE>CIM_ComputerSystem</VALUE> - </PROPERTY> <PROPERTY NAME="SystemName" TYPE="string"> <VALUE>localhost.localdomain</VALUE> </PROPERTY> - <PROPERTY NAME="CreationClassName" TYPE="string"> - <VALUE>CIM_IndicationHandlerCIMXML</VALUE> - </PROPERTY> <PROPERTY NAME="Name" TYPE="string"> <VALUE>Test_Indication_Handler_</VALUE> </PROPERTY> hooks/post-receive -- SFCB - Small Footprint CIM Broker |