Skip to content

Commit

Permalink
Merge pull request #22 from punchycode/master
Browse files Browse the repository at this point in the history
bug fix for latest API release.
  • Loading branch information
chmouel committed Sep 14, 2012
2 parents 2a63fd1 + 319a3b7 commit 13db24b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions clouddns/connection.py
Expand Up @@ -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():
Expand Down Expand Up @@ -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)
Expand All @@ -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'],
Expand Down

0 comments on commit 13db24b

Please sign in to comment.