add multiple server support to nova reset-state
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-novaclient |
Fix Released
|
Wishlist
|
ugvddm |
Bug Description
It would be nice if nova reset-state supported specifying multiple servers in a single invocation, similar to nova delete.
usage: nova reset-state [--active] <server>
usage: nova delete <server> [<server> ...]
It can be scripted similar to below, but it would be nice to have the command line support.
#!/bin/bash
set -e
function usage() {
echo "Usage: nova-reset-state [--active] [--all] [--help] -- [<server> ...]"
}
active=""
all=false
while [ $# -ne 0 ]; do
case "$1" in
--all) all=true; shift;;
--active) active="--active"; shift;;
--help) usage; exit 1;;
--) shift; break;
esac
done
if [ "$all" = true ]; then
servers=($(nova list | awk 'NR > 2 { print $2 }'))
for server in "${servers[@]}"; do
nova reset-state $active $server
done
else
for server in "$@"; do
nova reset-state $active $server
done
fi
Changed in nova: | |
importance: | Undecided → Wishlist |
tags: | added: api |
tags: | added: low-hanging-fruit |
Changed in nova: | |
assignee: | nobody → ugvddm (271025598-9) |
affects: | nova → python-novaclient |
Changed in python-novaclient: | |
milestone: | none → 2.18.0 |
Changed in python-novaclient: | |
status: | Fix Committed → Fix Released |
Hi Thang, Would this have to be fixed in the v3 api or could it be fixed in v1, or neither?