From 836fcb6cf2cfdd24c28f517fd10d7c5955738d38 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Fri, 8 May 2015 14:05:53 -0700 Subject: [PATCH] vmlist.py: Allow outputfile == None for list_nova too Signed-off-by: Dan Mick --- tools/vmlist.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/vmlist.py b/tools/vmlist.py index 19d45efd..a1536c36 100755 --- a/tools/vmlist.py +++ b/tools/vmlist.py @@ -118,6 +118,8 @@ def list_vms(host, outputfile): def list_nova(outputfile): + if outputfile is None: + outputfile = sys.stdout cloud_user = cfg.get('cloud_user') cloud_password = cfg.get('cloud_password') cloud_project = cfg.get('cloud_project') @@ -134,7 +136,8 @@ def list_nova(outputfile): ] outputfile.writelines(output) outputfile.flush() - outputfile.seek(0) + if outputfile != sys.stdout: + outputfile.seek(0) usage = """ -- 2.47.3