Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-ganeti
Commits
a2656173
Commit
a2656173
authored
Oct 15, 2007
by
Michael Hanselmann
Browse files
Make “gnt-os diagnose” exit 1 if not all OSes are valid.
Reviewed-by: iustinp
parent
d7e49c13
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/gnt-os
View file @
a2656173
...
...
@@ -174,6 +174,8 @@ def DiagnoseOS(opts, args):
logger
.
ToStdout
(
format
%
(
max_name
,
'Name'
,
max_node
,
'Status/Node'
,
'Details'
))
has_bad
=
False
for
os_name
in
all_os
:
nodes_valid
=
{}
nodes_bad
=
{}
...
...
@@ -192,8 +194,10 @@ def DiagnoseOS(opts, args):
status
=
"valid"
elif
not
nodes_valid
and
nodes_bad
:
status
=
"invalid"
has_bad
=
True
else
:
status
=
"partial valid"
has_bad
=
True
def
_OutputNodeHiddenOSStatus
(
dobj_list
):
for
dobj
in
dobj_list
:
...
...
@@ -213,6 +217,8 @@ def DiagnoseOS(opts, args):
_OutputPerNodeOSStatus
(
nodes_valid
)
_OutputPerNodeOSStatus
(
nodes_bad
)
return
int
(
has_bad
)
commands
=
{
'list'
:
(
ListOS
,
ARGS_NONE
,
[
DEBUG_OPT
,
NOHDR_OPT
],
""
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment