Skip to content

Commit

Permalink
fix: cleanup changes made by pre-commit scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
major0 authored and dwoz committed Oct 7, 2020
1 parent c4e5f09 commit 886cfef
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions salt/modules/boto_vpc.py
Expand Up @@ -196,7 +196,7 @@ def __init__(opts):


def check_vpc(
vpc_id=None, vpc_name=None, region=None, key=None, keyid=None, profile=None
vpc_id=None, vpc_name=None, region=None, key=None, keyid=None, profile=None,
):
"""
Check whether a VPC with the given name or id exists.
Expand Down Expand Up @@ -606,7 +606,7 @@ def _find_vpcs(
)

if vpcs:
if not any ((vpc_id, vpc_name, cidr, tags)):
if not any((vpc_id, vpc_name, cidr, tags)):
return [vpc.id for vpc in vpcs if vpc.is_default]
else:
return [vpc.id for vpc in vpcs]
Expand All @@ -615,16 +615,21 @@ def _find_vpcs(


def _get_id(
vpc_name=None, cidr=None, tags=None, region=None, key=None, keyid=None, profile=None
vpc_name=None,
cidr=None,
tags=None,
region=None,
key=None,
keyid=None,
profile=None,
):
"""
Given VPC properties, return the VPC id if a match is found.
"""

if not any((vpc_name, tags, cidr)):
raise SaltInvocationError(
"At least one of the following must be "
"provided: vpc_name, cidr or tags."
"At least one of the following must be provided: vpc_name, cidr or tags."
)

if vpc_name and not any((cidr, tags)):
Expand Down Expand Up @@ -667,7 +672,7 @@ def _get_id(


def get_id(
name=None, cidr=None, tags=None, region=None, key=None, keyid=None, profile=None
name=None, cidr=None, tags=None, region=None, key=None, keyid=None, profile=None,
):
"""
Given VPC properties, return the VPC id if a match is found.
Expand Down Expand Up @@ -878,7 +883,7 @@ def delete(


def describe(
vpc_id=None, vpc_name=None, region=None, key=None, keyid=None, profile=None
vpc_id=None, vpc_name=None, region=None, key=None, keyid=None, profile=None,
):
"""
Describe a VPC's properties. If no VPC ID/Name is spcified then describe the default VPC.
Expand All @@ -905,7 +910,8 @@ def describe(
region=region,
key=key,
keyid=keyid,
profile=profile)
profile=profile,
)
except BotoServerError as err:
boto_err = __utils__["boto.get_error"](err)
if boto_err.get("aws", {}).get("code") == "InvalidVpcID.NotFound":
Expand Down

0 comments on commit 886cfef

Please sign in to comment.