Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions waterbutler/core/remote_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@utils.async_retry(retries=5, backoff=5)
async def log_to_callback(action, source=None, destination=None, start_time=None, errors=[]):
"""PUT a logging payload back to the callback given by the auth provider."""
if action in ('download_file', 'download_zip'):
if action in ('download_file', 'download_zip', 'metadata'):
logger.debug('Not logging for {} action'.format(action))
return

Expand All @@ -41,10 +41,6 @@ async def log_to_callback(action, source=None, destination=None, start_time=None
log_payload['metadata'] = source.serialize()
log_payload['provider'] = log_payload['metadata']['provider']

if action in ('download_file', 'download_zip'):
logger.info('Not logging for {} action'.format(action))
return

resp = await utils.send_signed_request('PUT', auth['callback_url'], log_payload)
resp_data = await resp.read()

Expand Down
8 changes: 3 additions & 5 deletions waterbutler/server/api/v1/provider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,10 @@ def on_finish(self):
if any((method in ('HEAD', 'OPTIONS'), status == 202, status > 302, status < 200)):
return

if method == 'GET' and 'meta' in self.request.query_arguments:
return

# Done here just because method is defined
action = {
'GET': lambda: 'download_file' if self.path.is_file else 'download_zip',
'GET': lambda: 'metadata' if 'meta' in self.request.query_arguments else (
'download_file' if self.path.is_file else 'download_zip'),
'PUT': lambda: ('create' if self.target_path.is_file else 'create_folder') if status == 201 else 'update',
'POST': lambda: 'move' if self.json['action'] == 'rename' else self.json['action'],
'DELETE': lambda: 'delete'
Expand All @@ -175,7 +173,7 @@ def _send_hook(self, action):
)
elif action in ('create', 'create_folder', 'update'):
source = LogPayload(self.resource, self.provider, metadata=self.metadata)
elif action in ('delete', 'download_file', 'download_zip'):
elif action in ('delete', 'download_file', 'download_zip', 'metadata'):
source = LogPayload(self.resource, self.provider, path=self.path)
else:
return
Expand Down