Skip to content

Commit

Permalink
Python tests: Set CREATE_NO_WINDOW flag for Popen
Browse files Browse the repository at this point in the history
On Windows if the flag CREATE_NO_WINDOW is not
specified when using subprocess.Popen, a new
window will appear with the new process.

The window is not necessary for the tests.
This patch addresses this issue by adding
the flag CREATE_NO_WINDOW for all subprocess.Popen
calls if the machine is running Windows.

Signed-off-by: Alin Balutoiu <[email protected]>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions>
Signed-off-by: Gurucharan Shetty <[email protected]>
  • Loading branch information
alinbalutoiu authored and shettyg committed Jan 3, 2017
1 parent 9e03d73 commit aaea918
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vtep/ovs-vtep
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ bfd_ref = {}

def call_prog(prog, args_list):
cmd = [prog, "-vconsole:off"] + args_list
output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()
creationFlags = 0
if sys.platform == 'win32':
creationFlags = 0x08000000 # CREATE_NO_WINDOW
output = subprocess.Popen(cmd, stdout=subprocess.PIPE,
creationflags=creationFlags).communicate()
if len(output) == 0 or output[0] is None:
output = ""
else:
Expand Down

0 comments on commit aaea918

Please sign in to comment.