Use Process lib for openstack cli 49/75149/2
authorSam Hague <shague@redhat.com>
Sun, 12 Aug 2018 19:38:13 +0000 (15:38 -0400)
committerSam Hague <shague@redhat.com>
Sun, 12 Aug 2018 19:44:57 +0000 (15:44 -0400)
Change-Id: Ib21107a2dae58a0bf7874cf6f430f7ef73fff3bf
Signed-off-by: Sam Hague <shague@redhat.com>
csit/libraries/OpenStackOperations.robot

index 5c6fd65ab83b6a62f782d405e5605b9cd3b34925..b51f6f26f0a69b7a73bf8e203575f2a4ab178807 100644 (file)
@@ -1,6 +1,7 @@
 *** Settings ***
 Documentation     Openstack library. This library is useful for tests to create network, subnet, router and vm instances
 Library           Collections
+Library           Process
 Library           OperatingSystem
 Library           RequestsLibrary
 Library           SSHLibrary
@@ -951,17 +952,18 @@ OpenStack CLI Get List
 OpenStack CLI
     [Arguments]    ${cmd}
     [Documentation]    Run the given OpenStack ${cmd} and log the output.
-    ${rc}    ${output} =    OperatingSystem.Run And Return Rc And Output    ${cmd}
-    BuiltIn.Log    ${output}
-    BuiltIn.Should Be True    '${rc}' == '0'
-    [Return]    ${output}
+    ${result} =    Process.Run Process    ${cmd}    shell=True
+    BuiltIn.Log    ${result.stdout}
+    BuiltIn.Log    ${result.stderr}
+    BuiltIn.Should Be True    '${result.rc}' == '0'
+    [Return]    ${result.stdout}
 
 OpenStack CLI With No Log
     [Arguments]    ${cmd}
     [Documentation]    Run the given OpenStack ${cmd} and do not log the output.
-    ${rc}    ${output} =    OperatingSystem.Run And Return Rc And Output    ${cmd}
-    BuiltIn.Should Be True    '${rc}' == '0'
-    [Return]    ${output}
+    ${result} =    Process.Run Process    ${cmd}    shell=True
+    BuiltIn.Should Be True    '${result.rc}' == '0'
+    [Return]    ${result.stdout}
 
 OpenStack Cleanup All
     [Documentation]    Cleanup all Openstack resources with best effort. The keyword will query for all resources