Bob Lantz
Committed by Gerrit Code Review

Allow output file or '-' for stdout with list of IP addresses

This doesn't seem quite right, because it doesn't match
a supposedly legal use case where you omit the output file
and list the node IP addresses. However, it's better than
what we have now, which simply ignores the output file name.

Intended to help with ONOS-4667

Change-Id: Ib46195e7b829bc4d304c4dd51138b73acd4f1501
(cherry picked from commit 50df0982)
......@@ -55,7 +55,7 @@ if __name__ == '__main__':
}
output = json.dumps(data, indent=4)
if len(sys.argv) == 2:
if len(sys.argv) >= 2 and sys.argv[1] != '-':
filename = sys.argv[1]
with open(filename, 'w') as f:
f.write(output)
......