Require flavor on instance-create call in the CLI.

Instead of defaulting to flavor 1, the create-instance call will now
require that a flavorid is included with --flavor= on the command-line.

Implements blueprint no-default-flavor

Change-Id: I1de05bf4268d617b255e0be2fd2c999d49952c49
This commit is contained in:
Ed Cranford 2013-02-12 16:40:46 -06:00
parent 901d8a0423
commit 0dccd261e5
1 changed files with 2 additions and 4 deletions

View File

@ -51,12 +51,10 @@ class InstanceCommands(common.AuthedCommandsBase):
def create(self):
"""Create a new instance"""
self._require('name', 'size')
# flavorRef is not required.
flavorRef = self.flavor or "http://localhost:8775/v1.0/flavors/1"
self._require('name', 'size', 'flavor')
volume = {"size": self.size}
self._pretty_print(self.dbaas.instances.create, self.name,
flavorRef, volume)
self.flavor, volume)
def delete(self):
"""Delete the specified instance"""