← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1314217] Re: add multiple server support to nova reset-state

 

** Project changed: nova => python-novaclient

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1314217

Title:
  add multiple server support to nova reset-state

Status in Python client library for Nova:
  Confirmed

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/python-novaclient/+bug/1314217/+subscriptions


References