Add lock state to node listing
Also make waitfornodes in the devstack script to wait for unlocked nodes. Change-Id: I76f35d46f66f9e3beafe9f5f5a93049256a8df44
This commit is contained in:
parent
d884a35937
commit
4e6dedfd0f
@ -33,21 +33,36 @@ def node_list(zk, node_id=None):
|
||||
t = PrettyTable(["ID", "Provider", "AZ", "Label",
|
||||
"Launcher", "Hostname", "Server ID",
|
||||
"Public IPv4", "Private IPv4", "IPv6",
|
||||
"State", "Age", "Comment"])
|
||||
"State", "Age", "Locked", "Comment"])
|
||||
t.align = 'l'
|
||||
if node_id:
|
||||
node = zk.getNode(node_id)
|
||||
if node:
|
||||
locked = "unlocked"
|
||||
try:
|
||||
zk.lockNode(node, blocking=False)
|
||||
except Exception:
|
||||
locked = "locked"
|
||||
else:
|
||||
zk.unlockNode(node)
|
||||
|
||||
t.add_row([node.id, node.provider, node.az, node.type,
|
||||
node.launcher, node.hostname, node.external_id,
|
||||
node.public_ipv4, node.private_ipv4, node.public_ipv6,
|
||||
node.state, age(node.state_time), node.comment])
|
||||
node.state, age(node.state_time), locked, node.comment])
|
||||
else:
|
||||
for node in zk.nodeIterator():
|
||||
locked = "unlocked"
|
||||
try:
|
||||
zk.lockNode(node, blocking=False)
|
||||
except Exception:
|
||||
locked = "locked"
|
||||
else:
|
||||
zk.unlockNode(node)
|
||||
t.add_row([node.id, node.provider, node.az, node.type,
|
||||
node.launcher, node.hostname, node.external_id,
|
||||
node.public_ipv4, node.private_ipv4, node.public_ipv6,
|
||||
node.state, age(node.state_time), node.comment])
|
||||
node.state, age(node.state_time), locked, node.comment])
|
||||
return str(t)
|
||||
|
||||
|
||||
|
@ -31,7 +31,7 @@ function waitfornode {
|
||||
name=$1
|
||||
state='ready'
|
||||
|
||||
while ! $NODEPOOL list | grep $name | grep $state; do
|
||||
while ! $NODEPOOL list | grep $name | grep $state | grep "unlocked"; do
|
||||
$NODEPOOL image-list > /tmp/.nodepool-image-list.txt
|
||||
$NODEPOOL list > /tmp/.nodepool-list.txt
|
||||
sudo mv /tmp/.nodepool-image-list.txt $WORKSPACE/logs/nodepool-image-list.txt
|
||||
|
Loading…
Reference in New Issue
Block a user