Skip to content

Commit

Permalink
dns/digitalocean: send attributes in body for PUT and POST operations.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsomething committed Oct 14, 2020
1 parent d5e957a commit ee5c1f7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libcloud/dns/drivers/digitalocean.py
Expand Up @@ -20,6 +20,8 @@
'DigitalOceanDNSDriver'
]

import json

from libcloud.utils.py3 import httplib

from libcloud.common.digitalocean import DigitalOcean_v2_BaseDriver
Expand Down Expand Up @@ -128,7 +130,7 @@ def create_zone(self, domain, type='master', ttl=None, extra=None):
except Exception:
params['ip_address'] = '127.0.0.1'

res = self.connection.request('/v2/domains', params=params,
res = self.connection.request('/v2/domains', data=json.dumps(params),
method='POST')

return Zone(id=res.object['domain']['name'],
Expand Down Expand Up @@ -183,7 +185,7 @@ def create_record(self, name, zone, type, data, extra=None):
params['ttl'] = extra['ttl']

res = self.connection.request('/v2/domains/%s/records' % zone.id,
params=params,
data=json.dumps(params),
method='POST')

return Record(id=res.object['domain_record']['id'],
Expand Down Expand Up @@ -243,7 +245,7 @@ def update_record(self, record, name=None, type=None,

res = self.connection.request('/v2/domains/%s/records/%s' %
(record.zone.id, record.id),
params=params,
data=json.dumps(params),
method='PUT')

return Record(id=res.object['domain_record']['id'],
Expand Down

0 comments on commit ee5c1f7

Please sign in to comment.