summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/src/main/java/org/onap/cli/fw/utils/ProcessRunner.java10
-rw-r--r--products/onap-dublin/features/multicloud/pom.xml41
-rw-r--r--products/onap-dublin/features/pom.xml1
3 files changed, 51 insertions, 1 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/utils/ProcessRunner.java b/framework/src/main/java/org/onap/cli/fw/utils/ProcessRunner.java
index 9b896230..eb335837 100644
--- a/framework/src/main/java/org/onap/cli/fw/utils/ProcessRunner.java
+++ b/framework/src/main/java/org/onap/cli/fw/utils/ProcessRunner.java
@@ -28,10 +28,14 @@ import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.apache.commons.io.IOUtils;
+import org.onap.cli.fw.cmd.OnapCommand;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class ProcessRunner {
+ private static Logger log = LoggerFactory.getLogger(ProcessRunner.class);
public static final String WIN_SHELL = "cmd.exe /c ";
- public static final String UNIX_SHELL = "sh -c ";
+ public static final String UNIX_SHELL = "";
private String []cmd = null;
private String shell = System.getProperty("os.name").toLowerCase().startsWith("windows") ? WIN_SHELL : UNIX_SHELL;
private String cwd = System.getProperty("user.home");
@@ -80,6 +84,7 @@ public class ProcessRunner {
Process p = null;
final StringWriter writerOutput = new StringWriter();
final StringWriter writerError = new StringWriter();
+
if (this.cmd.length == 1) {
p = Runtime.getRuntime().exec(this.shell + this.cmd[0], this.env, null);
} else {
@@ -113,6 +118,9 @@ public class ProcessRunner {
this.exitCode = p.exitValue();
this.output = writerOutput.toString();
this.error = writerError.toString();
+ log.debug("CMD: " + Arrays.asList(this.cmd).toString() + "\nWORKING_DIR: " + this.cwd + "\nENV: " +
+ ((this.env == null) ? this.env : Arrays.asList(this.env).toString()) +
+ "\nOUTPUT: " + this.output + "\nERROR: " + this.error + "\nEXIT_CODE: " + this.exitCode);
p.destroy();
}
diff --git a/products/onap-dublin/features/multicloud/pom.xml b/products/onap-dublin/features/multicloud/pom.xml
new file mode 100644
index 00000000..3fe2dd0b
--- /dev/null
+++ b/products/onap-dublin/features/multicloud/pom.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright © Intel Corporation 2018
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.cli</groupId>
+ <artifactId>cli-products-onap-dublin-features</artifactId>
+ <version>2.0.6</version>
+ </parent>
+
+ <artifactId>cli-products-onap-dublin-features-multicloud</artifactId>
+ <name>cli/products/onap-dublin/features/multicloud</name>
+ <packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/products/onap-dublin/features/pom.xml b/products/onap-dublin/features/pom.xml
index 9c0cc7fa..3b6335ff 100644
--- a/products/onap-dublin/features/pom.xml
+++ b/products/onap-dublin/features/pom.xml
@@ -36,6 +36,7 @@
<module>msb</module>
<module>sdc</module>
<module>policy</module>
+ <module>multicloud</module>
</modules>
<build>