Skip to content

Commit

Permalink
Only set owner information if present
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Jan 4, 2013
1 parent 4e78eb2 commit 022cf54
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tilecloud/lib/s3.py
Expand Up @@ -172,8 +172,12 @@ def list_objects(self, marker=None, max_keys=None, prefix=None):
kwargs['etag'] = contents_element.find(self.ETAG_PATH).text
kwargs['size'] = int(contents_element.find(self.SIZE_PATH).text)
kwargs['storage_class'] = contents_element.find(self.STORAGE_CLASS_PATH).text
kwargs['owner_id'] = contents_element.find(self.OWNER_ID_PATH).text
kwargs['owner_display_name'] = contents_element.find(self.OWNER_DISPLAY_NAME_PATH).text
owner_id = contents_element.find(self.OWNER_ID_PATH)
if owner_id:
kwargs['owner_id'] = owner_id.text
owner_display_name = contents_element.find(self.OWNER_DISPLAY_NAME_PATH)
if owner_display_name:
kwargs['owner_display_name'] = owner_display_name.text
yield S3Key(key_name, self, **kwargs)
if etree.find(self.IS_TRUNCATED_PATH).text == 'true':
marker = key_name
Expand Down

0 comments on commit 022cf54

Please sign in to comment.