mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
boto_vpc: lint
This commit is contained in:
parent
682b4940c8
commit
76f739d7c7
@ -127,8 +127,7 @@ def _check_vpc(vpc_id, vpc_name, region, key, keyid, profile):
|
||||
if vpc_name:
|
||||
vpc_id = _get_id(vpc_name=vpc_name, region=region, key=key, keyid=keyid,
|
||||
profile=profile)
|
||||
else:
|
||||
if not _find_vpcs(vpc_id=vpc_id, region=region, key=key, keyid=keyid,
|
||||
elif not _find_vpcs(vpc_id=vpc_id, region=region, key=key, keyid=keyid,
|
||||
profile=profile):
|
||||
log.info('VPC {0} does not exist.'.format(vpc_id))
|
||||
return None
|
||||
@ -203,7 +202,6 @@ def _delete_resource(resource, name=None, resource_id=None, region=None,
|
||||
except AttributeError:
|
||||
raise AttributeError('{0} function does not exist for boto VPC '
|
||||
'connection.'.format('delete_' + resource))
|
||||
|
||||
if name:
|
||||
resource_id = _get_resource_id(resource, name,
|
||||
region=region, key=key,
|
||||
@ -522,7 +520,6 @@ def create(cidr_block, instance_tenancy=None, vpc_name=None,
|
||||
|
||||
'''
|
||||
|
||||
|
||||
try:
|
||||
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
|
||||
vpc = conn.create_vpc(cidr_block, instance_tenancy=instance_tenancy)
|
||||
|
@ -15,10 +15,11 @@ ensure_in_syspath('../../')
|
||||
# Import Salt libs
|
||||
import salt.config
|
||||
import salt.loader
|
||||
|
||||
# pylint: disable=import-error
|
||||
from unit.modules.boto_vpc_test import BotoVpcTestCaseMixin
|
||||
|
||||
# Import 3rd-party libs
|
||||
# pylint: disable=import-error
|
||||
try:
|
||||
import boto
|
||||
from boto.exception import BotoServerError
|
||||
@ -81,10 +82,12 @@ def _has_required_boto():
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
class BotoVpcStateTestCaseBase(TestCase):
|
||||
def setUp(self):
|
||||
ctx.clear()
|
||||
|
||||
|
||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
||||
@skipIf(HAS_BOTO is False, 'The boto module must be installed.')
|
||||
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
|
||||
|
Loading…
Reference in New Issue
Block a user