Skip to content

Commit

Permalink
1. moved the messages to constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit Negi committed May 25, 2018
1 parent 929cee6 commit 9e6d060
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lamlight/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
CODE_PULLING_ERROR = "cannot load the code base for '{}' lambda "
PACKAGIN_ERROR = "Could not create the code package."
NO_LAMLIGHT_PROJECT = 'Not a Lamlight project. Get in lamlight by connection to one lambda function'


LAMBDA_ALREADY_EXISTS = " Lambda function with '{}' name already exists."
DIRECTORY_ALREADY_EXISTS = 'Directory with name {} already exists'
# console commands
PIP_UPGRADE = "pip install --upgrade pip"
PIP_REQ_INSTALL = "pip install --upgrade --no-cache-dir -r requirements.txt -t temp_dependencies/"
Expand Down
6 changes: 3 additions & 3 deletions lamlight/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ def create_lambda(name, role, subnet_id, security_group):
"""

if os.path.exists(name):
raise errors.BaseException('Directory with name {} already exists'.format(name))
raise errors.BaseException(consts.DIRECTORY_ALREADY_EXISTS.format(name))

if lambda_utils.lambda_function_exists(name):
raise errors.AWSError(
" Lambda function with '{}' name already exists.".format(name))
consts.LAMBDA_ALREADY_EXISTS.format(name))
os.mkdir(name)
logger.info('Creating Scaffolding for lambda function.')
logger.info('Creating boilderplate for lambda function.')
hlpr.create_package(name)

logger.info('Building Zip.')
Expand Down

0 comments on commit 9e6d060

Please sign in to comment.