Repository: oozie Updated Branches: refs/heads/master 350ce480e -> 1fd6a6b41
OOZIE-2027 Disable re-runs using the workflow directly if it has a parent (jaydeepvishwakarma via shwethags) - patch2 Project: http://git-wip-us.apache.org/repos/asf/oozie/repo Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/1fd6a6b4 Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/1fd6a6b4 Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/1fd6a6b4 Branch: refs/heads/master Commit: 1fd6a6b415becfab1e559687ae50183af2184de4 Parents: 350ce48 Author: Shwetha GS <[email protected]> Authored: Wed May 20 12:28:22 2015 +0530 Committer: Shwetha GS <[email protected]> Committed: Wed May 20 12:28:22 2015 +0530 ---------------------------------------------------------------------- core/src/main/java/org/apache/oozie/command/wf/ReRunXCommand.java | 2 +- .../test/java/org/apache/oozie/command/wf/TestReRunXCommand.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oozie/blob/1fd6a6b4/core/src/main/java/org/apache/oozie/command/wf/ReRunXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/command/wf/ReRunXCommand.java b/core/src/main/java/org/apache/oozie/command/wf/ReRunXCommand.java index bb6d4e7..31996d1 100644 --- a/core/src/main/java/org/apache/oozie/command/wf/ReRunXCommand.java +++ b/core/src/main/java/org/apache/oozie/command/wf/ReRunXCommand.java @@ -337,7 +337,7 @@ public class ReRunXCommand extends WorkflowXCommand<Void> { // through conf. if (wfBean.getParentId() != null && !conf.getBoolean(SubWorkflowActionExecutor.SUBWORKFLOW_RERUN, false) && ConfigurationService.getBoolean(DISABLE_CHILD_RERUN)) { - throw new PreconditionException(ErrorCode.E0755, " Rerun is not allowed through child workflow, please" + + throw new CommandException(ErrorCode.E0755, " Rerun is not allowed through child workflow, please" + " re-run through the parent " + wfBean.getParentId()); } http://git-wip-us.apache.org/repos/asf/oozie/blob/1fd6a6b4/core/src/test/java/org/apache/oozie/command/wf/TestReRunXCommand.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/command/wf/TestReRunXCommand.java b/core/src/test/java/org/apache/oozie/command/wf/TestReRunXCommand.java index c9bbd00..02f6166 100644 --- a/core/src/test/java/org/apache/oozie/command/wf/TestReRunXCommand.java +++ b/core/src/test/java/org/apache/oozie/command/wf/TestReRunXCommand.java @@ -428,8 +428,11 @@ public class TestReRunXCommand extends XDataTestCase { Properties newConf = wfClient.createConfiguration(); newConf.setProperty(OozieClient.RERUN_FAIL_NODES, "true"); Services.get().getConf().setBoolean(ReRunXCommand.DISABLE_CHILD_RERUN, true); + try { wfClient.reRun(wfId, newConf); + fail("OozieClientException should have been thrown (" + ErrorCode.E0755 + + " Rerun is not allowed through child workflow, please re-run through the parent)"); } catch (OozieClientException ex){ assertEquals(ErrorCode.E0755.toString(), ex.getErrorCode()); }
