list blob messages in container

def list(self, storagemodel:object, modeldefinition = None, where=None) ->list:
        """ list blob messages in container """
        try:
            blobnames = []
            if where is None:
                generator = modeldefinition['blobservice'].list_blobs(modeldefinition['container'])
            else:
                generator = modeldefinition['blobservice'].list_blobs(modeldefinition['container'], prefix=where)

            for blob in generator:
                blobnames.append(blob)

        except Exception as e:
            msg = 'can not list blobs in container {} because {!s}'.format(storagemodel._containername, e)
            raise AzureStorageWrapException(storagemodel, msg=msg)
           
        finally:
            return blobnames