Linting
This commit is contained in:
parent
cb6731f340
commit
273ca63d59
92 changed files with 515 additions and 1200 deletions
|
|
@ -340,9 +340,7 @@ class InvalidDependantParameterError(EC2ClientError):
|
|||
super(InvalidDependantParameterError, self).__init__(
|
||||
"InvalidParameter",
|
||||
"{0} can't be empty if {1} is {2}.".format(
|
||||
dependant_parameter,
|
||||
parameter,
|
||||
parameter_value,
|
||||
dependant_parameter, parameter, parameter_value,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
@ -352,9 +350,7 @@ class InvalidDependantParameterTypeError(EC2ClientError):
|
|||
super(InvalidDependantParameterTypeError, self).__init__(
|
||||
"InvalidParameter",
|
||||
"{0} type must be {1} if {2} is provided.".format(
|
||||
dependant_parameter,
|
||||
parameter_value,
|
||||
parameter,
|
||||
dependant_parameter, parameter_value, parameter,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
@ -362,8 +358,7 @@ class InvalidDependantParameterTypeError(EC2ClientError):
|
|||
class InvalidAggregationIntervalParameterError(EC2ClientError):
|
||||
def __init__(self, parameter):
|
||||
super(InvalidAggregationIntervalParameterError, self).__init__(
|
||||
"InvalidParameter",
|
||||
"Invalid {0}".format(parameter),
|
||||
"InvalidParameter", "Invalid {0}".format(parameter),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1491,12 +1491,7 @@ class AmiBackend(object):
|
|||
# Limit by owner ids
|
||||
if owners:
|
||||
# support filtering by Owners=['self']
|
||||
owners = list(
|
||||
map(
|
||||
lambda o: OWNER_ID if o == "self" else o,
|
||||
owners,
|
||||
)
|
||||
)
|
||||
owners = list(map(lambda o: OWNER_ID if o == "self" else o, owners,))
|
||||
images = [ami for ami in images if ami.owner_id in owners]
|
||||
|
||||
# Generic filters
|
||||
|
|
@ -3710,17 +3705,13 @@ class FlowLogsBackend(object):
|
|||
):
|
||||
if log_group_name is None and log_destination is None:
|
||||
raise InvalidDependantParameterError(
|
||||
"LogDestination",
|
||||
"LogGroupName",
|
||||
"not provided",
|
||||
"LogDestination", "LogGroupName", "not provided",
|
||||
)
|
||||
|
||||
if log_destination_type == "s3":
|
||||
if log_group_name is not None:
|
||||
raise InvalidDependantParameterTypeError(
|
||||
"LogDestination",
|
||||
"cloud-watch-logs",
|
||||
"LogGroupName",
|
||||
"LogDestination", "cloud-watch-logs", "LogGroupName",
|
||||
)
|
||||
elif log_destination_type == "cloud-watch-logs":
|
||||
if deliver_logs_permission_arn is None:
|
||||
|
|
@ -3868,8 +3859,7 @@ class FlowLogsBackend(object):
|
|||
|
||||
if non_existing:
|
||||
raise InvalidFlowLogIdError(
|
||||
len(flow_log_ids),
|
||||
" ".join(x for x in flow_log_ids),
|
||||
len(flow_log_ids), " ".join(x for x in flow_log_ids),
|
||||
)
|
||||
return True
|
||||
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ class VPCs(BaseResponse):
|
|||
|
||||
def enable_vpc_classic_link_dns_support(self):
|
||||
vpc_id = self._get_param("VpcId")
|
||||
classic_link_dns_supported = (
|
||||
self.ec2_backend.enable_vpc_classic_link_dns_support(vpc_id=vpc_id)
|
||||
classic_link_dns_supported = self.ec2_backend.enable_vpc_classic_link_dns_support(
|
||||
vpc_id=vpc_id
|
||||
)
|
||||
doc_date = self._get_doc_date()
|
||||
template = self.response_template(ENABLE_VPC_CLASSIC_LINK_DNS_SUPPORT_RESPONSE)
|
||||
|
|
@ -81,8 +81,8 @@ class VPCs(BaseResponse):
|
|||
|
||||
def disable_vpc_classic_link_dns_support(self):
|
||||
vpc_id = self._get_param("VpcId")
|
||||
classic_link_dns_supported = (
|
||||
self.ec2_backend.disable_vpc_classic_link_dns_support(vpc_id=vpc_id)
|
||||
classic_link_dns_supported = self.ec2_backend.disable_vpc_classic_link_dns_support(
|
||||
vpc_id=vpc_id
|
||||
)
|
||||
doc_date = self._get_doc_date()
|
||||
template = self.response_template(DISABLE_VPC_CLASSIC_LINK_DNS_SUPPORT_RESPONSE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue