Skip to content

Commit 8c9fb7b

Browse files
committed
Merge pull request #3 from BD2KGenomics/issues/s3am#35-no-credentials-fix
Fix test for empty credentials cache (resolves BD2KGenomic/s3am#35)
2 parents fddbe68 + 231e55c commit 8c9fb7b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/bd2k/util/ec2/credentials.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ def _populate_keys_from_metadata_server( self ):
7878
log.debug( 'Attempting to read cached credentials from %s.', path )
7979
try:
8080
with open( path, 'r' ) as f:
81-
record = f.read( ).split( '\n' )
82-
if record:
81+
content = f.read( )
82+
if content:
83+
record = content.split( '\n' )
84+
assert len(record) == 4
8385
self._access_key = record[ 0 ]
8486
self._secret_key = record[ 1 ]
8587
self._security_token = record[ 2 ]

0 commit comments

Comments
 (0)