Update boto_efs.py

pylint
This commit is contained in:
Michael Lodder 2016-12-30 11:47:26 -07:00 committed by Michael Lodder
parent 8063f58966
commit 0a769d5989

View File

@ -46,6 +46,7 @@ Connection module for Amazon EFS
:depends: boto3 :depends: boto3
''' '''
# Import python libs # Import python libs
import logging import logging
from distutils.version import LooseVersion as _LooseVersion from distutils.version import LooseVersion as _LooseVersion
@ -70,11 +71,11 @@ def __virtual__():
required_boto_version = '1.0.0' required_boto_version = '1.0.0'
if not HAS_BOTO3: if not HAS_BOTO3:
return (False, "The boto3.efs module cannot be loaded: " + \ return (False, "The boto3.efs module cannot be loaded: " +
"boto3 library not found") "boto3 library not found")
elif _LooseVersion(boto3.__version__) < \ elif _LooseVersion(boto3.__version__) < \
_LooseVersion(required_boto_version): _LooseVersion(required_boto_version):
return (False, "The boto3.efs module cannot be loaded:"+ \ return (False, "The boto3.efs module cannot be loaded:" +
"boto3 library version incorrect") "boto3 library version incorrect")
else: else:
return True return True
@ -104,7 +105,6 @@ def _get_conn(key=None,
if region: if region:
profile['region'] = region profile['region'] = region
if isinstance(profile, dict): if isinstance(profile, dict):
if 'region' in profile: if 'region' in profile:
profile['region_name'] = profile['region'] profile['region_name'] = profile['region']
@ -333,7 +333,7 @@ def get_file_systems(filesystemid=None,
client = _get_conn(key=key, keyid=keyid, profile=profile, region=region) client = _get_conn(key=key, keyid=keyid, profile=profile, region=region)
if filesystemid: if filesystemid:
response = client.describe_file_systems(FileSystemId) response = client.describe_file_systems(FileSystemId=filesystemid)
result = response["FileSystems"] result = response["FileSystems"]
else: else:
response = client.describe_file_systems() response = client.describe_file_systems()
@ -435,4 +435,4 @@ def set_security_groups(mounttargetid,
client = _get_conn(key=key, keyid=keyid, profile=profile, region=region) client = _get_conn(key=key, keyid=keyid, profile=profile, region=region)
client.modify_mount_target_security_groups(MountTargetId=mounttargetid, client.modify_mount_target_security_groups(MountTargetId=mounttargetid,
SecurityGroups=securitygroups) SecurityGroups=securitygroup)