You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by of...@apache.org on 2020/05/22 09:37:48 UTC

[incubator-dlab] 01/01: Added dir option to mock

This is an automated email from the ASF dual-hosted git repository.

ofuks pushed a commit to branch DLAB-1476
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 518c54c47edda8141e1f28aa96df014792b35a12
Author: Oleh Fuks <ol...@gmail.com>
AuthorDate: Wed Feb 19 14:54:38 2020 +0200

    Added dir option to mock
---
 .../dlab/backendapi/core/commands/CommandExecutorMockAsync.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/CommandExecutorMockAsync.java b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/CommandExecutorMockAsync.java
index bfa7af6..af87134 100644
--- a/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/CommandExecutorMockAsync.java
+++ b/services/provisioning-service/src/main/java/com/epam/dlab/backendapi/core/commands/CommandExecutorMockAsync.java
@@ -233,7 +233,7 @@ public class CommandExecutorMockAsync implements Supplier<Boolean> {
 	 * @throws FileNotFoundException may be thrown
 	 */
 	private String findTemplatesDir() throws FileNotFoundException {
-		String dir = "/opt/dlab/sources/infrastructure-provisioning/src/general/files/" + cloudProvider.getName();
+		String dir = System.getProperty("docker.dir");
 
 		if (dir != null) {
 			dir = getAbsolutePath(dir);
@@ -256,6 +256,10 @@ public class CommandExecutorMockAsync implements Supplier<Boolean> {
 		if (dirExists(dir)) {
 			return dir;
 		}
+		dir = "/opt/dlab/sources/infrastructure-provisioning/src/general/files/" + cloudProvider.getName();
+		if (dirExists(dir)) {
+			return dir;
+		}
 		throw new FileNotFoundException("Directory \"" + dir + "\" not found. " +
 				"Please set the value docker.dir property to the " +
 				"\".../infrastructure-provisioning/src/general/files/" + cloudProvider.getName() + "\" directory");


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org