Author: virag
Date: Tue Dec 4 03:32:35 2012
New Revision: 1416760
URL: http://svn.apache.org/viewvc?rev=1416760&view=rev
Log:
OOZIE-1094 credential cannot resolve variable (virag)
Modified:
oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java
oozie/branches/branch-3.3/release-log.txt
Modified:
oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
URL:
http://svn.apache.org/viewvc/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java?rev=1416760&r1=1416759&r2=1416760&view=diff
==============================================================================
---
oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
(original)
+++
oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java
Tue Dec 4 03:32:35 2012
@@ -776,7 +776,7 @@ public class JavaActionExecutor extends
WorkflowAction action, Configuration actionConf) throws Exception {
HashMap<String, CredentialsProperties> credPropertiesMap = null;
if (context != null && action != null) {
- credPropertiesMap = getActionCredentialsProperties(context,
action, actionConf);
+ credPropertiesMap = getActionCredentialsProperties(context,
action);
if (credPropertiesMap != null) {
for (String key : credPropertiesMap.keySet()) {
CredentialsProperties prop = credPropertiesMap.get(key);
@@ -823,14 +823,14 @@ public class JavaActionExecutor extends
}
protected HashMap<String, CredentialsProperties>
getActionCredentialsProperties(Context context,
- WorkflowAction action, Configuration conf) throws Exception {
+ WorkflowAction action) throws Exception {
HashMap<String, CredentialsProperties> props = new HashMap<String,
CredentialsProperties>();
if (context != null && action != null) {
String credsInAction = action.getCred();
log.debug("Get credential '" + credsInAction + "' properties for
action : " + action.getId());
String[] credNames = credsInAction.split(",");
for (String credName : credNames) {
- CredentialsProperties credProps = getCredProperties(context,
credName, conf);
+ CredentialsProperties credProps = getCredProperties(context,
credName);
props.put(credName, credProps);
}
}
@@ -841,10 +841,11 @@ public class JavaActionExecutor extends
}
@SuppressWarnings("unchecked")
- protected CredentialsProperties getCredProperties(Context context, String
credName, Configuration conf)
+ protected CredentialsProperties getCredProperties(Context context, String
credName)
throws Exception {
CredentialsProperties credProp = null;
String workflowXml = ((WorkflowJobBean)
context.getWorkflow()).getWorkflowInstance().getApp().getDefinition();
+ XConfiguration wfjobConf = new XConfiguration(new
StringReader(context.getWorkflow().getConf()));
Element elementJob = XmlUtils.parseXml(workflowXml);
Element credentials = elementJob.getChild("credentials",
elementJob.getNamespace());
if (credentials != null) {
@@ -859,7 +860,7 @@ public class JavaActionExecutor extends
String propertyName = property.getChildText("name",
property.getNamespace());
String propertyValue = property.getChildText("value",
property.getNamespace());
ELEvaluator eval = new ELEvaluator();
- for (Map.Entry<String, String> entry : conf) {
+ for (Map.Entry<String, String> entry : wfjobConf) {
eval.setVariable(entry.getKey(),
entry.getValue().trim());
}
propertyName = eval.evaluate(propertyName,
String.class);
Modified:
oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java
URL:
http://svn.apache.org/viewvc/oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java?rev=1416760&r1=1416759&r2=1416760&view=diff
==============================================================================
---
oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java
(original)
+++
oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/action/hadoop/TestJavaActionExecutor.java
Tue Dec 4 03:32:35 2012
@@ -773,8 +773,6 @@ public class TestJavaActionExecutor exte
Element actionXmlconf = XmlUtils.parseXml(action.getConf());
// action job configuration
Configuration actionConf = ae.createBaseHadoopConf(context,
actionXmlconf);
- actionConf.set("property3", "prop3");
- actionConf.set("value3", "val3");
// Setting the credential properties in launcher conf
HashMap<String, CredentialsProperties> credProperties =
ae.setCredentialPropertyToActionConf(context,
@@ -807,6 +805,8 @@ public class TestJavaActionExecutor exte
conf.set(OozieClient.APP_PATH, getNameNodeUri() + "/testPath");
conf.set(OozieClient.LOG_TOKEN, "testToken");
conf.set(OozieClient.USER_NAME, getTestUser());
+ conf.set("property3", "prop3");
+ conf.set("value3", "val3");
WorkflowJobBean wfBean = createWorkflow(app, conf, "auth");
wfBean.setId(wfId);
Modified: oozie/branches/branch-3.3/release-log.txt
URL:
http://svn.apache.org/viewvc/oozie/branches/branch-3.3/release-log.txt?rev=1416760&r1=1416759&r2=1416760&view=diff
==============================================================================
--- oozie/branches/branch-3.3/release-log.txt (original)
+++ oozie/branches/branch-3.3/release-log.txt Tue Dec 4 03:32:35 2012
@@ -1,5 +1,6 @@
-- Oozie 3.3.1 (unreleased)
+OOZIE-1094 credential cannot resolve variable (virag)
OOZIE-1099 Pig launcher log does not show the pig job url for H23 (rohini via
mona)
OOZIE-1100 HFTP coordinator input check fails due to missing
commons-httpclient.jar (ryota via virag)
OOZIE-1065 bundle status does not transit after rerun (virag)