Permalink
Browse files

Merge pull request #22 from punchycode/master

bug fix for latest API release.
  • Loading branch information...
2 parents 2a63fd1 + 319a3b7 commit 13db24b477666242e83144dd854abaa729588e9f @chmouel chmouel committed Sep 14, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 clouddns/connection.py
View
@@ -127,7 +127,8 @@ def make_request(self, method, path=[], data='', hdrs=None, parms=None):
headers = {'Content-Length': str(len(data)),
'User-Agent': self.user_agent,
- 'X-Auth-Token': self.token}
+ 'X-Auth-Token': self.token,
+ 'Content-Type': 'application/xml'}
isinstance(hdrs, dict) and headers.update(hdrs)
def retry_request():
@@ -219,7 +220,7 @@ def wait_for_async_request(self, response):
jobId = output['jobId']
while True:
response = self.make_request('GET', ['status', jobId],
- parms=['showDetails=True'])
+ parms=['showDetails=True'])
if (response.status < 200) or (response.status > 299):
response.read()
raise ResponseError(response.status, response.reason)
@@ -231,10 +232,10 @@ def wait_for_async_request(self, response):
except KeyError:
return output
if output['status'] == 'ERROR':
- if (output['error']['code'] == 409 and
+ if (output['error']['code'] == 409 and
output['error']['details'] == 'Domain already exists'):
raise DomainAlreadyExists
- if (output['error']['code'] == 409 and
+ if (output['error']['code'] == 409 and
output['error']['details'].find('belongs to another owner')):
raise NotDomainOwner
raise ResponseError(output['error']['code'],

0 comments on commit 13db24b

Please sign in to comment.