# HG changeset patch # User neko259 # Date 2016-05-13 20:58:47 # Node ID 8b72916c60a53711d2510b5ef16de3335037e21b # Parent 8fb1b3b10653148b19a68adb61c7be5c08d87fee Log requests during sync. Remove request body from log cause it is too large diff --git a/boards/management/commands/sync_with_server.py b/boards/management/commands/sync_with_server.py --- a/boards/management/commands/sync_with_server.py +++ b/boards/management/commands/sync_with_server.py @@ -43,7 +43,6 @@ class Command(BaseCommand): local_id=local_id) xml = GlobalId.objects.generate_request_get([global_id]) - # body = urllib.parse.urlencode(data) h = httplib2.Http() response, content = h.request(get_url, method="POST", body=xml) @@ -51,12 +50,11 @@ class Command(BaseCommand): else: raise Exception('Invalid global ID') else: + print('Running LIST request') h = httplib2.Http() xml = GlobalId.objects.generate_request_list() response, content = h.request(list_url, method="POST", body=xml) - print(content.decode() + '\n') - root = ET.fromstring(content) status = root.findall('status')[0].text if status == 'success': @@ -79,8 +77,8 @@ class Command(BaseCommand): limit = options.get('split_query', len(ids_to_sync)) for offset in range(0, len(ids_to_sync), limit): xml = GlobalId.objects.generate_request_get(ids_to_sync[offset:offset+limit]) - # body = urllib.parse.urlencode(data) h = httplib2.Http() + print('Running GET request') response, content = h.request(get_url, method="POST", body=xml) SyncManager.parse_response_get(content, file_url)