Add quiet option in xdsh call

Add quiet option in xdsh call to ignore warnings and ssh banner
message.

To fix the defect that xdsh call failed when ssh banner enabled.

Change-Id: Icecdc5be94f5d5009e6a744eebeb2bdd1e747b2f
This commit is contained in:
Huang Rui 2016-04-21 14:10:53 +08:00
parent 2b10f37781
commit 7e3fdd0ed0
2 changed files with 4 additions and 2 deletions

View File

@ -732,7 +732,7 @@ class ZVMDriverTestCases(ZVMTestCase):
res_fspace = self._gen_resp(info=["gpok164: Free Image "
"Repository: 13.9G"])
url_xdsh = self._app_auth('/xcatws/nodes/os000001/dsh')
body_cmd = ["command=df -h /"]
body_cmd = ["command=df -h /", "options=-q"]
res_img_need = self._gen_resp(data=["Filesystem Size Used Avail Use% "
"Mounted on /dev/dasda1 6.8G "
"5.2G 1.3G 81% /"])

View File

@ -533,7 +533,9 @@ def xdsh(node, commands):
def xdsh_execute(node, commands):
"""Invoke xCAT REST API to execute command on node."""
xdsh_commands = 'command=%s' % commands
body = [xdsh_commands]
# Add -q (quiet) option to ignore ssh warnings and banner msg
opt = 'options=-q'
body = [xdsh_commands, opt]
url = XCATUrl().xdsh('/' + node)
return xcat_request("PUT", url, body)