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
3ef10550
Commit
3ef10550
authored
Oct 08, 2007
by
Michael Hanselmann
Browse files
Add boot id to “gnt-node list”.
Reviewed-by: iustinp
parent
b9ea6acb
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/backend.py
View file @
3ef10550
...
...
@@ -170,6 +170,12 @@ def GetNodeInfo(vgname):
if
hyp_info
is
not
None
:
outputarray
.
update
(
hyp_info
)
f
=
open
(
"/proc/sys/kernel/random/boot_id"
,
'r'
)
try
:
outputarray
[
"bootid"
]
=
f
.
read
(
128
).
rstrip
(
"
\n
"
)
finally
:
f
.
close
()
return
outputarray
...
...
lib/cmdlib.py
View file @
3ef10550
...
...
@@ -1198,7 +1198,8 @@ class LUQueryNodes(NoHooksLU):
"""
self
.
dynamic_fields
=
frozenset
([
"dtotal"
,
"dfree"
,
"mtotal"
,
"mnode"
,
"mfree"
])
"mtotal"
,
"mnode"
,
"mfree"
,
"bootid"
])
_CheckOutputFields
(
static
=
[
"name"
,
"pinst_cnt"
,
"sinst_cnt"
,
"pinst_list"
,
"sinst_list"
,
...
...
@@ -1229,6 +1230,7 @@ class LUQueryNodes(NoHooksLU):
"mfree"
:
utils
.
TryConvert
(
int
,
nodeinfo
[
'memory_free'
]),
"dtotal"
:
utils
.
TryConvert
(
int
,
nodeinfo
[
'vg_size'
]),
"dfree"
:
utils
.
TryConvert
(
int
,
nodeinfo
[
'vg_free'
]),
"bootid"
:
nodeinfo
[
'bootid'
],
}
else
:
live_data
[
name
]
=
{}
...
...
scripts/gnt-node
View file @
3ef10550
...
...
@@ -58,7 +58,8 @@ def ListNodes(opts, args):
"pinst_list"
:
"PriInstances"
,
"sinst_list"
:
"SecInstances"
,
"pip"
:
"PrimaryIP"
,
"sip"
:
"SecondaryIP"
,
"dtotal"
:
"DTotal"
,
"dfree"
:
"DFree"
,
"mtotal"
:
"MTotal"
,
"mnode"
:
"MNode"
,
"mfree"
:
"MFree"
}
"mtotal"
:
"MTotal"
,
"mnode"
:
"MNode"
,
"mfree"
:
"MFree"
,
"bootid"
:
"BootID"
}
else
:
headers
=
None
...
...
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