Skip to content

Commit 85701b4

Browse files
committed
Merge pull request #79 from rackerlabs/error_on_dir
Raise an exception if the config passed is not a valid conf file
2 parents d102901 + 0ea5a1d commit 85701b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lambda_uploader/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ def _load_config(self, lambda_file=None):
124124
if not lambda_file:
125125
lambda_file = path.join(self._path, 'lambda.json')
126126

127-
if not path.isfile(lambda_file):
128-
raise Exception("%s not found" % lambda_file)
127+
if not path.isfile(lambda_file) or path.isdir(lambda_file):
128+
raise Exception("%s not a valid configuration file" % lambda_file)
129129

130130
with open(lambda_file) as config_file:
131131
self._config = json.load(config_file)

0 commit comments

Comments
 (0)