Fix gtaskqueue to not pass in body={}. Also fix bug with 0 length POSTs. Reviewed in http://codereview.appspot.com/5694067/.
This commit is contained in:
@@ -379,6 +379,8 @@ class HttpRequest(object):
|
||||
_, body = self.next_chunk(http)
|
||||
return body
|
||||
else:
|
||||
if 'content-length' not in self.headers:
|
||||
self.headers['content-length'] = str(self.body_size)
|
||||
resp, content = http.request(self.uri, self.method,
|
||||
body=self.body,
|
||||
headers=self.headers)
|
||||
|
||||
@@ -86,8 +86,7 @@ class LeaseTaskCommand(GoogleTaskCommand):
|
||||
return task_api.lease(project=flag_values.project_name,
|
||||
taskqueue=flag_values.taskqueue_name,
|
||||
leaseSecs=flag_values.lease_secs,
|
||||
numTasks=flag_values.num_tasks,
|
||||
body={})
|
||||
numTasks=flag_values.num_tasks)
|
||||
|
||||
def print_result(self, result):
|
||||
"""Override to optionally strip the payload since it can be long."""
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
import os
|
||||
import sys
|
||||
import urlparse
|
||||
from apiclient.anyjson import simplejson as json
|
||||
from apiclient.discovery import build
|
||||
from apiclient.errors import HttpError
|
||||
import httplib2
|
||||
from oauth2client.anyjson import simplejson as json
|
||||
from oauth2client.file import Storage
|
||||
from oauth2client.client import OAuth2WebServerFlow
|
||||
from oauth2client.tools import run
|
||||
|
||||
@@ -27,8 +27,8 @@ import urlparse
|
||||
|
||||
from apiclient.discovery import build
|
||||
from apiclient.errors import HttpError
|
||||
from apiclient.anyjson import simplejson as json
|
||||
import httplib2
|
||||
from oauth2client.anyjson import simplejson as json
|
||||
from oauth2client.file import Storage
|
||||
from oauth2client.client import OAuth2WebServerFlow
|
||||
from oauth2client.tools import run
|
||||
|
||||
Reference in New Issue
Block a user