You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2021/05/02 21:17:09 UTC

[libcloud] branch trunk updated: Fix null value in DigitalOcean create record

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 7b88819  Fix null value in DigitalOcean create record
     new f78db46  Merge pull request #1570 from karantan/fix/digitalocean-extra
7b88819 is described below

commit 7b88819b2c75a7abe029eda119e77b086cdde9e0
Author: Gasper Vozel <gv...@niteo.co>
AuthorDate: Wed Mar 17 07:57:08 2021 +0100

    Fix null value in DigitalOcean create record
    
    This fixes "field could not be unmarshalled" error when trying to send
    'null' as a boolean value. It needs to be int or bool, not a string.
    
    Ref: https://developers.digitalocean.com/documentation/v2/#create-a-new-domain-record
---
 libcloud/dns/drivers/digitalocean.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libcloud/dns/drivers/digitalocean.py b/libcloud/dns/drivers/digitalocean.py
index e393b05..08f413b 100644
--- a/libcloud/dns/drivers/digitalocean.py
+++ b/libcloud/dns/drivers/digitalocean.py
@@ -171,15 +171,15 @@ class DigitalOceanDNSDriver(DigitalOcean_v2_BaseDriver, DNSDriver):
             try:
                 params['priority'] = extra['priority']
             except KeyError:
-                params['priority'] = 'null'
+                params['priority'] = None
             try:
                 params['port'] = extra['port']
             except KeyError:
-                params['port'] = 'null'
+                params['port'] = None
             try:
                 params['weight'] = extra['weight']
             except KeyError:
-                params['weight'] = 'null'
+                params['weight'] = None
 
             if 'ttl' in extra:
                 params['ttl'] = extra['ttl']