softlayer / softlayer-object-storage-python

SoftLayer Object Storage Python Client
Other
19 stars 30 forks source link

small fix to is_dir() #37

Closed abendig closed 8 years ago

abendig commented 9 years ago

The is_dir() method was raising an unhandled exception in this code:

    def is_dir(self):
        """ returns True if content_type is 'text/directory' or
            'application/directory' """
        return self.model['content_type'] in ['text/directory',
                                              'application/directory']

First, it's possible for self.model to be None. Even if it's set though, such as after running load() the raised exception indicates StorageObjectModel instance has no attribute content_type.

The fix simply accesses the properties dictionary.

briancline commented 8 years ago

Thank you!