瀏覽代碼

AMBARI-11673 [WinTP2] ambari-server setup --jdbc-driver displays bogus error

+Fixed arguments with spaces in Powershell
Florian Barca 10 年之前
父節點
當前提交
cb2a69aa4d
共有 2 個文件被更改,包括 28 次插入0 次删除
  1. 14 0
      ambari-agent/conf/windows/ambari-agent.ps1
  2. 14 0
      ambari-server/src/main/windows/ambari-server.ps1

+ 14 - 0
ambari-agent/conf/windows/ambari-agent.ps1

@@ -30,6 +30,20 @@ switch ($($args[0])){
   }
 }
 
+# Handle spaces in command line arguments properly
+$quoted_args=@()
+
+ForEach ($arg in $args)
+{
+  if($arg.Contains(' '))
+  {
+    $arg = """" + $arg + """"
+  }
+  $quoted_args = $quoted_args + @($arg)
+}
+
+$args = $quoted_args
+
 $AMBARI_AGENT="ambari-agent"
 $AMBARI_SVC_NAME = "Ambari Agent"
 $current_directory = (Get-Item -Path ".\" -Verbose).FullName

+ 14 - 0
ambari-server/src/main/windows/ambari-server.ps1

@@ -30,6 +30,20 @@ switch ($($args[0])){
   }
 }
 
+# Handle spaces in command line arguments properly
+$quoted_args=@()
+
+ForEach ($arg in $args)
+{
+  if($arg.Contains(' '))
+  {
+    $arg = """" + $arg + """"
+  }
+  $quoted_args = $quoted_args + @($arg)
+}
+
+$args = $quoted_args
+
 $AMBARI_SERVER="ambari-server"
 $AMBARI_SVC_NAME = "Ambari Server"
 $current_directory = (Get-Item -Path ".\" -Verbose).FullName