> -----Original Message-----
> From: Nagendra Kumar [mailto:[email protected]]
> Sent: den 28 januari 2014 08:37
> To: Hans Feldt
> Cc: [email protected]
> Subject: Re: [devel] [PATCH 2 of 2] amfnd: ignore saAmfCtSwBundle when 
> abspath in CLC-CLI cmds [#662]
> 
> Nack.
> 
> 1. Do the same changes for AmStart and AmStop.
> 2. The below check is not required once validation is done at amfd:
> > +   if ((res != 0) && (comptype->saAmfCtRelPathCleanupCmd[0] != '/')) {

OK will send an updated patch
/Hans

> 
> Thanks
> -Nagu
> 
> > -----Original Message-----
> > From: Hans Feldt [mailto:[email protected]]
> > Sent: 07 January 2014 02:07
> > To: Nagendra Kumar
> > Cc: [email protected]
> > Subject: [PATCH 2 of 2] amfnd: ignore saAmfCtSwBundle when abspath in CLC-
> > CLI cmds [#662]
> >
> >  osaf/services/saf/amf/amfnd/compdb.cc |  52 ++++++++++++++++++++++-----
> > -------
> >  1 files changed, 34 insertions(+), 18 deletions(-)
> >
> >
> > diff --git a/osaf/services/saf/amf/amfnd/compdb.cc
> > b/osaf/services/saf/amf/amfnd/compdb.cc
> > --- a/osaf/services/saf/amf/amfnd/compdb.cc
> > +++ b/osaf/services/saf/amf/amfnd/compdb.cc
> > @@ -956,10 +956,10 @@ static amf_comp_type_t *avnd_comptype_cr
> >     if
> > (immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfCtCompCategory"),
> > attributes, 0, &compt->saAmfCtCompCategory) != SA_AIS_OK)
> >             osafassert(0);
> >
> > -   if (IS_COMP_LOCAL(compt->saAmfCtCompCategory) &&
> > -
> > immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfCtSwBundle"),
> > attributes, 0, &compt->saAmfCtSwBundle) != SA_AIS_OK) {
> > -           osafassert(0);
> > -           return NULL;
> > +   if (IS_COMP_LOCAL(compt->saAmfCtCompCategory)) {
> > +           // Ignore if not found, commands can be specified with
> > absolute path
> > +
> >     immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfCtSwBundle"),
> > +                   attributes, 0, &compt->saAmfCtSwBundle);
> >     }
> >
> >
> > immutil_getAttrValuesNumber(const_cast<SaImmAttrNameT>("saAmfCtDefCm
> > dEnv"), attributes, &j);
> > @@ -1170,18 +1170,17 @@ done:
> >  }
> >
> >  /**
> > - * Initialize the bundle dependent attributes in comp (the
> > - * CLC-CLI commands).
> > + * Initializes the CLC-CLI commands in a component.
> >   *
> > - * If path in comptype for AM & HC scripts is absolute it is
> > - * used, else (it is relative) it is prepended with path prefix.
> > + * If path in comptype is absolute it is used, else (it is relative) it is
> > + * prepended with path prefix.
> >   *
> >   * @param comp
> >   * @param comptype
> >   * @param path_prefix
> >   * @param attributes
> >   */
> > -static void init_bundle_dependent_attributes(AVND_COMP *comp,
> > +static void init_clc_cli_commands(AVND_COMP *comp,
> >                             const amf_comp_type_t *comptype,
> >                             const char *path_prefix,
> >                             const SaImmAttrValuesT_2 **attributes)
> > @@ -1194,8 +1193,13 @@ static void init_bundle_dependent_attrib
> >     cmd = &comp-
> > >clc_info.cmds[AVND_COMP_CLC_CMD_TYPE_INSTANTIATE - 1];
> >     if (comptype->saAmfCtRelPathInstantiateCmd != NULL) {
> >             i = 0;
> > -           i += snprintf(&cmd->cmd[i], sizeof(cmd->cmd) - i, "%s/%s",
> > -                   path_prefix, comptype-
> > >saAmfCtRelPathInstantiateCmd);
> > +
> > +           if (comptype->saAmfCtRelPathInstantiateCmd[0] == '/')
> > +                   i += snprintf(&cmd->cmd[i], sizeof(cmd->cmd) - i,
> > "%s",
> > +                           comptype->saAmfCtRelPathInstantiateCmd);
> > +           else
> > +                   i += snprintf(&cmd->cmd[i], sizeof(cmd->cmd) - i,
> > "%s/%s",
> > +                           path_prefix, comptype-
> > >saAmfCtRelPathInstantiateCmd);
> >
> >             j = 0;
> >             while ((argv = comptype-
> > >saAmfCtDefInstantiateCmdArgv[j++]) != NULL)
> > @@ -1215,8 +1219,13 @@ static void init_bundle_dependent_attrib
> >     cmd = &comp-
> > >clc_info.cmds[AVND_COMP_CLC_CMD_TYPE_TERMINATE - 1];
> >     if (comptype->saAmfCtRelPathTerminateCmd != NULL) {
> >             i = 0;
> > -           i += snprintf(&cmd->cmd[i], sizeof(cmd->cmd) - i, "%s/%s",
> > -                   path_prefix, comptype-
> > >saAmfCtRelPathTerminateCmd);
> > +
> > +           if (comptype->saAmfCtRelPathTerminateCmd[0] == '/')
> > +                   i += snprintf(&cmd->cmd[i], sizeof(cmd->cmd) - i,
> > "%s",
> > +                           comptype->saAmfCtRelPathTerminateCmd);
> > +           else
> > +                   i += snprintf(&cmd->cmd[i], sizeof(cmd->cmd) - i,
> > "%s/%s",
> > +                           path_prefix, comptype-
> > >saAmfCtRelPathTerminateCmd);
> >
> >             j = 0;
> >             while ((argv = comptype->saAmfCtDefTerminateCmdArgv[j++])
> > != NULL)
> > @@ -1236,8 +1245,13 @@ static void init_bundle_dependent_attrib
> >     cmd = &comp-
> > >clc_info.cmds[AVND_COMP_CLC_CMD_TYPE_CLEANUP - 1];
> >     if (comptype->saAmfCtRelPathCleanupCmd != NULL) {
> >             i = 0;
> > -           i += snprintf(&cmd->cmd[i], sizeof(cmd->cmd) - i, "%s/%s",
> > -                   path_prefix, comptype->saAmfCtRelPathCleanupCmd);
> > +
> > +           if (comptype->saAmfCtRelPathCleanupCmd[0] == '/')
> > +                   i += snprintf(&cmd->cmd[i], sizeof(cmd->cmd) - i,
> > "%s",
> > +                           comptype->saAmfCtRelPathCleanupCmd);
> > +           else
> > +                   i += snprintf(&cmd->cmd[i], sizeof(cmd->cmd) - i,
> > "%s/%s",
> > +                           path_prefix, comptype-
> > >saAmfCtRelPathCleanupCmd);
> >
> >             j = 0;
> >             while ((argv = comptype->saAmfCtDefCleanupCmdArgv[j++])
> > != NULL)
> > @@ -1383,9 +1397,11 @@ static int comp_init(AVND_COMP *comp, co
> >     res = get_string_attr_from_imm(immOmHandle,
> > const_cast<SaImmAttrNameT>("saAmfNodeSwBundlePathPrefix"),
> >             &nodeswbundle_name, &path_prefix);
> >
> > -   if (res == 0) {
> > -           init_bundle_dependent_attributes(comp, comptype,
> > path_prefix, attributes);
> > -   } else {
> > +   // Initialize commands also when path prefix is not found
> > +   init_clc_cli_commands(comp, comptype, path_prefix, attributes);
> > +
> > +   // Treat missing path prefix as an error only if command is not absolute
> > +   if ((res != 0) && (comptype->saAmfCtRelPathCleanupCmd[0] != '/')) {
> >             if (bundle_missing_is_error) {
> >                     LOG_NO("%s: '%s'", __FUNCTION__, comp-
> > >name.value);
> >                     LOG_ER("%s: FAILED to read '%s'", __FUNCTION__,
> > nodeswbundle_name.value);
> 
> ------------------------------------------------------------------------------
> WatchGuard Dimension instantly turns raw network data into actionable
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends.  Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
> _______________________________________________
> Opensaf-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to