Merge "Remove unused arguments to _boot()"

This commit is contained in:
Jenkins 2014-03-31 18:00:30 +00:00 committed by Gerrit Code Review
commit ec7e95d65e
2 changed files with 6 additions and 26 deletions

View File

@ -129,19 +129,8 @@ def _parse_block_device_mapping_v2(args, image):
return bdm
def _boot(cs, args, reservation_id=None, min_count=None, max_count=None):
def _boot(cs, args):
"""Boot a new server."""
if min_count is None:
min_count = 1
if max_count is None:
max_count = min_count
if min_count > max_count:
raise exceptions.CommandError(_("min_instances should be <= "
"max_instances"))
if not min_count or not max_count:
raise exceptions.CommandError(_("min_instances nor max_instances "
"should be 0"))
if args.image:
image = _find_image(cs, args.image)
else:
@ -157,6 +146,8 @@ def _boot(cs, args, reservation_id=None, min_count=None, max_count=None):
if not args.flavor:
raise exceptions.CommandError(_("you need to specify a Flavor ID "))
min_count = 1
max_count = 1
if args.num_instances is not None:
if args.num_instances <= 1:
raise exceptions.CommandError(_("num_instances should be > 1"))
@ -280,7 +271,6 @@ def _boot(cs, args, reservation_id=None, min_count=None, max_count=None):
meta=meta,
files=files,
key_name=key_name,
reservation_id=reservation_id,
min_count=min_count,
max_count=max_count,
userdata=userdata,

View File

@ -60,19 +60,8 @@ def _match_image(cs, wanted_properties):
return images_matched
def _boot(cs, args, reservation_id=None, min_count=None, max_count=None):
def _boot(cs, args):
"""Boot a new server."""
if min_count is None:
min_count = 1
if max_count is None:
max_count = min_count
if min_count > max_count:
raise exceptions.CommandError("min_instances should be <= "
"max_instances")
if not min_count or not max_count:
raise exceptions.CommandError("min_instances nor max_instances should"
"be 0")
if args.image:
image = _find_image(cs.image_cs, args.image)
else:
@ -93,6 +82,8 @@ def _boot(cs, args, reservation_id=None, min_count=None, max_count=None):
if not args.flavor:
raise exceptions.CommandError("you need to specify a Flavor ID ")
min_count = 1
max_count = 1
if args.num_instances is not None:
if args.num_instances <= 1:
raise exceptions.CommandError("num_instances should be > 1")
@ -191,7 +182,6 @@ def _boot(cs, args, reservation_id=None, min_count=None, max_count=None):
meta=meta,
files=files,
key_name=key_name,
reservation_id=reservation_id,
min_count=min_count,
max_count=max_count,
userdata=userdata,