Skip to content

Commit

Permalink
fixes lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoav committed Nov 11, 2017
1 parent e092aea commit 83ba5f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions gimel/aws_api.py
Expand Up @@ -30,6 +30,7 @@ def check_aws_credentials():
session.get_credentials().access_key
session.get_credentials().secret_key


iam = partial(aws, 'iam')
aws_lambda = partial(aws, 'lambda')
apigateway = partial(aws, 'apigateway')
11 changes: 6 additions & 5 deletions gimel/deploy.py
Expand Up @@ -2,6 +2,7 @@
import logger
from botocore.client import ClientError
import os
import redis
from zipfile import ZipFile, ZipInfo, ZIP_DEFLATED
from aws_api import iam, apigateway, aws_lambda, region, check_aws_credentials

Expand Down Expand Up @@ -230,12 +231,12 @@ def rollback_lambda(name, alias=LIVE):
try:
live_index = all_versions.index(live_version)
if live_index < 1:
raise
raise RuntimeError('Cannot find previous version')
prev_version = all_versions[live_index - 1]
logger.info('rolling back to version {}'.format(prev_version))
_function_alias(name, prev_version)
except:
logger.error('Unable to rollback. Cannot find previous version')
except RuntimeError as error:
logger.error('Unable to rollback. {}'.format(repr(error)))


def rollback(alias=LIVE):
Expand Down Expand Up @@ -474,7 +475,7 @@ def preflight_checks():
try:
from gimel import _redis
_redis().ping()
except:
except redis.exceptions.ConnectionError:
logger.error('Redis ping failed. Please run gimel configure')
return False
return True
Expand All @@ -496,5 +497,5 @@ def run():
preflight_checks()
run()
js_code_snippet()
except:
except Exception:
logger.error('preflight checks failed')

0 comments on commit 83ba5f3

Please sign in to comment.