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


If SI and its protecting SG belong to different application, then
Amf throws errors while assigning SIs to SUs.
This is because there will not be any compcsi matching
with SI and its protecting SG.
SO, now added validation for making sure SI and its protecting SG
belong to the same application, else throws errors during
SI creation.

diff --git a/osaf/services/saf/amf/amfd/si.cc b/osaf/services/saf/amf/amfd/si.cc
--- a/osaf/services/saf/amf/amfd/si.cc
+++ b/osaf/services/saf/amf/amfd/si.cc
@@ -472,7 +472,7 @@ static int is_config_valid(const SaNameT
        SaAisErrorT rc;
        SaNameT aname;
        SaAmfAdminStateT admstate;
-       char *parent;
+       char *parent, *app;
 
        if ((parent = strchr((char*)dn->value, ',')) == NULL) {
                report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
@@ -518,6 +518,17 @@ static int is_config_valid(const SaNameT
                }
        }
 
+       /* saAmfSIProtectedbySG and SI should belong to the same applicaion. */
+       if ((app = strchr((char*)aname.value, ',')) == NULL) {
+               report_ccb_validation_error(opdata, "No parent to '%s' ", 
aname.value);
+               return 0;
+       }
+       if (strcmp(parent, ++app)) {
+               report_ccb_validation_error(opdata, "SI '%s' and SG '%s' belong 
to different application",
+                               dn->value, aname.value);
+               return 0;
+       }
+
        if ((immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfSIAdminState"), 
attributes, 0, &admstate) == SA_AIS_OK) &&
            !avd_admin_state_is_valid(admstate)) {
                report_ccb_validation_error(opdata, "Invalid saAmfSIAdminState 
%u for '%s'", admstate, dn->value);

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to