You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by sh...@apache.org on 2015/05/20 10:12:44 UTC
oozie git commit: OOZIE-2027 Disable re-runs using the workflow
directly if it has a parent (jaydeepvishwakarma via shwethags) - patch2
Repository: oozie
Updated Branches:
refs/heads/branch-4.2 c0148e2d3 -> 791ec93ae
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/791ec93a
Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/791ec93a
Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/791ec93a
Branch: refs/heads/branch-4.2
Commit: 791ec93ae62e68c552663b49461cf635b9898d83
Parents: c0148e2
Author: Shwetha GS <ss...@hortonworks.com>
Authored: Wed May 20 12:29:14 2015 +0530
Committer: Shwetha GS <ss...@hortonworks.com>
Committed: Wed May 20 12:29:14 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/791ec93a/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/791ec93a/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());
}