> On Oct. 8, 2015, 7 p.m., Sumit Mohanty wrote: > > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java, > > line 213 > > <https://reviews.apache.org/r/38890/diff/3/?file=1093189#file1093189line213> > > > > Why do we need to remove this check. This is applied when the action > > definition has TargetHostType as Specific. If its not then this check will > > not be called. > > Vitalyi Brodetskyi wrote: > Sumit, not sure that it was correct "if" construction. Please take a look > at it: > {code} > if (TargetHostType.SPECIFIC.equals(actionDef.getTargetType()) || > (targetService.isEmpty() && targetComponent.isEmpty())) > {code} > this "if" construction checks, if (TargetHostType == SPECIFIC) *OR* > (targetService and targetComponent are empty). So, all requests even with > targetHostType other than SPECIFIC, will enter to this check, if > targetService and targetComponent were not set(most of our custom actions). > > Should i leave this check for targetHostType == SPECIFIC, like if > (TargetHostType.SPECIFIC.equals(actionDef.getTargetType()) then ... ?
Yes, the if check needs to be modified. It should not report error for targetTypes ALL, ANY, and MAJORITY if host list is empty. - Sumit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/38890/#review101949 ----------------------------------------------------------- On Oct. 8, 2015, 3:13 p.m., Vitalyi Brodetskyi wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/38890/ > ----------------------------------------------------------- > > (Updated Oct. 8, 2015, 3:13 p.m.) > > > Review request for Ambari, Andrew Onischuk, Dmitro Lisnichenko, Dmytro Sen, > and Sumit Mohanty. > > > Bugs: AMBARI-13274 > https://issues.apache.org/jira/browse/AMBARI-13274 > > > Repository: ambari > > > Description > ------- > > Even though in the AmbariUI (Ambari >> Admin >> Manage Ambari >> versions >> > click on the correct version) you have the correct repos. The > HDP.repo/repoinfo.xml file doesn't get updated in the agent nodes even after > restart of ambari-server and ambari-agents. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java > 1c110fc > > ambari-server/src/main/resources/custom_action_definitions/system_action_definitions.xml > 777ced7 > ambari-server/src/main/resources/custom_actions/scripts/update_repo.py > PRE-CREATION > ambari-server/src/test/python/custom_actions/TestUpdateRepo.py PRE-CREATION > > Diff: https://reviews.apache.org/r/38890/diff/ > > > Testing > ------- > > mvn clean test > > > Thanks, > > Vitalyi Brodetskyi > >
