Browse code

add more comments

Taras Postument authored on 2018/05/08 18:54:36
Showing 1 changed files
... ...
@@ -296,7 +296,7 @@ class Config(object):
296 296
                 # if header is missing, this could be deprecated credentials file format
297 297
                 # as described here: https://blog.csanchez.org/2011/05/
298 298
                 # then do the hacky-hack and add default header
299
-                # to be able to readt he file with PyConfigParser() 
299
+                # to be able to read the file with PyConfigParser() 
300 300
                 config_string = None
301 301
                 with open(aws_credential_file, 'r') as f:
302 302
                     config_string = '[default]\n' + f.read()
... ...
@@ -314,16 +314,16 @@ class Config(object):
314 314
                 try:
315 315
                     result = config.get(profile, key)
316 316
                 except NoOptionError as e:
317
-                    if print_warning:
317
+                    if print_warning: # we may want to skip warning message for optional keys
318 318
                         warning("Couldn't find key '%s' for the AWS Profile '%s' in the credentials file '%s'" % (e.option, e.section, aws_credential_file))
319
-                    if legacy_key: 
319
+                    if legacy_key: # if the legacy_key defined and original one wasn't found, try read the legacy_key
320 320
                         try:
321 321
                             key = legacy_key
322 322
                             profile = "default"
323 323
                             result = config.get(profile, key)
324 324
                             warning(
325 325
                                     "Legacy configuratin key '%s' used, " % (key) + 
326
-                                    "please use the standartized config format as described here: " +
326
+                                    "please use the standardized config format as described here: " +
327 327
                                     "https://aws.amazon.com/blogs/security/a-new-and-standardized-way-to-manage-credentials-in-the-aws-sdks/"
328 328
                                      )
329 329
                         except NoOptionError as e: