Commit 58bc8fbc authored by Iustin Pop's avatar Iustin Pop
Browse files

Make gnt-os list work with no OSes

When absolutely no OSes are present on the cluster, the result of
OpOsDiagnose is an empty list. This is currently handled in gnt-os as
an error condition, probably due to how OpOsDiagnose used to return
errors in the past.

However, with the query backend, an empty list is a reasonable answer,
so I see no reason why gnt-os should treat that as an error,
especially as it doesn't give any hint of what is "wrong". Simply
removing that code block allows it to proceed normally, and list no
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 16a833d7
# Copyright (C) 2006, 2007, 2010 Google Inc.
# Copyright (C) 2006, 2007, 2010, 2013 Google Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -45,10 +45,6 @@ def ListOS(opts, args):
op = opcodes.OpOsDiagnose(output_fields=["name", "variants"], names=[])
result = SubmitOpCode(op, opts=opts)
if not result:
ToStderr("Can't get the OS list")
return 1
if not opts.no_headers:
headers = {"name": "Name"}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment