From 17a8b78eecf4a69299f9550008e743d01c57f738 Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Tue, 25 Mar 2014 10:25:06 -0700 Subject: [PATCH] Remove unused arguments to _boot() reservation_id, min_count, max_count are never specified by any callers. Remove the arguments and the code that checks the values. Change-Id: I3794fd1eabbfb999c422c701af1ff64cd667313f --- novaclient/v1_1/shell.py | 16 +++------------- novaclient/v3/shell.py | 16 +++------------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/novaclient/v1_1/shell.py b/novaclient/v1_1/shell.py index e3171976d..a2a50bbab 100644 --- a/novaclient/v1_1/shell.py +++ b/novaclient/v1_1/shell.py @@ -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, diff --git a/novaclient/v3/shell.py b/novaclient/v3/shell.py index 10a6975d8..cbf25051a 100644 --- a/novaclient/v3/shell.py +++ b/novaclient/v3/shell.py @@ -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,