diff --git a/awscli/customizations/ec2/addcount.py b/awscli/customizations/ec2/addcount.py index 16a2a16ae3ed..120b2b8548aa 100644 --- a/awscli/customizations/ec2/addcount.py +++ b/awscli/customizations/ec2/addcount.py @@ -15,18 +15,20 @@ from botocore import model from awscli.arguments import BaseCLIArgument +from awscli.customizations.exceptions import ParamValidationError logger = logging.getLogger(__name__) DEFAULT = 1 -HELP = """ -

Number of instances to launch. If a single number is provided, it -is assumed to be the minimum to launch (defaults to %d). If a range is -provided in the form min:max then the first number is -interpreted as the minimum number of instances to launch and the second -is interpreted as the maximum number of instances to launch.

""" % DEFAULT +HELP = ( + "\n

Number of instances to launch. If a single number is provided, it\n" + f"is assumed to be the minimum to launch (defaults to {DEFAULT:d}). If a range is\n" + "provided in the form min:max then the first number is\n" + "interpreted as the minimum number of instances to launch and the second\n" + "is interpreted as the maximum number of instances to launch.

" +) def register_count_events(event_handler): @@ -90,7 +92,7 @@ def add_to_params(self, parameters, value): minstr, maxstr = (value, value) parameters['MinCount'] = int(minstr) parameters['MaxCount'] = int(maxstr) - except: + except Exception: msg = ('count parameter should be of ' 'form min[:max] (e.g. 1 or 1:10)') raise ParamValidationError(msg)