osaf/services/saf/amf/amfd/comptype.cc |  24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/comptype.cc 
b/osaf/services/saf/amf/amfd/comptype.cc
--- a/osaf/services/saf/amf/amfd/comptype.cc
+++ b/osaf/services/saf/amf/amfd/comptype.cc
@@ -108,11 +108,6 @@ static AVD_COMP_TYPE *comptype_create(co
 
        (void)immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfCtSwBundle"), 
attributes, 0, &compt->saAmfCtSwBundle);
 
-       if (!IS_COMP_PROXIED(compt->saAmfCtCompCategory) && 
IS_COMP_LOCAL(compt->saAmfCtCompCategory)) {
-          error = 
immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfCtSwBundle"), attributes, 0, 
&compt->saAmfCtSwBundle);
-               osafassert(error == SA_AIS_OK);
-       }
-
        if ((str = immutil_getStringAttr(attributes, "saAmfCtDefCmdEnv", 0)) != 
NULL)
                strcpy(compt->saAmfCtDefCmdEnv, str);
        
(void)immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfCtDefClcCliTimeout"), 
attributes, 0, &compt->saAmfCtDefClcCliTimeout);
@@ -231,16 +226,23 @@ static int is_config_valid(const SaNameT
        ** non-proxied local components".
        */
        if (!(IS_COMP_PROXIED(category) || IS_COMP_PROXIED_NPI(category)) && 
IS_COMP_LOCAL(category)) {
+               const char *cmd = immutil_getStringAttr(attributes, 
"saAmfCtRelPathInstantiateCmd", 0);
 
-               if 
(immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfCtSwBundle"), attributes, 0, 
&name) != SA_AIS_OK) {
-                       report_ccb_validation_error(opdata, "Required attribute 
saAmfCtSwBundle not configured for '%s'",
-                                       dn->value);
+               if (cmd == NULL) {
+                       report_ccb_validation_error(opdata,
+                                       "Required attribute 
saAmfCtRelPathInstantiateCmd not configured"
+                                       " for '%s'", dn->value);
                        return 0;
                }
 
-               if (immutil_getStringAttr(attributes, 
"saAmfCtRelPathInstantiateCmd", 0) == NULL) {
-                       report_ccb_validation_error(opdata, "Required attribute 
saAmfCtRelPathInstantiateCmd not configured"
-                                       " for '%s'", dn->value);
+               // saAmfCtSwBundle required but only if cmd is a relative path
+               if ((cmd[0] != '/') &&
+                       
(immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfCtSwBundle"),
+                                                        attributes, 0, &name) 
!= SA_AIS_OK)) {
+                       report_ccb_validation_error(opdata,
+                                       "saAmfCtRelPathInstantiateCmd is not an 
absolute path and"
+                                       "attribute saAmfCtSwBundle is not 
configured for '%s'",
+                                       dn->value);
                        return 0;
                }
        }

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to