From eefe1510a81a3cfa041f6d90df09b433e8f123cf Mon Sep 17 00:00:00 2001 From: Alex Gridnev Date: Mon, 23 Jan 2023 14:04:04 +0400 Subject: [PATCH] Support float for "allowed_bandwidth_gb" parameter in server info APIs response. (#35) --- plugins/inventory/vultr.py | 2 +- plugins/modules/vultr_server.py | 6 +++--- plugins/modules/vultr_server_baremetal.py | 6 +++--- plugins/modules/vultr_server_info.py | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/inventory/vultr.py b/plugins/inventory/vultr.py index bc2d2b5..a44b471 100644 --- a/plugins/inventory/vultr.py +++ b/plugins/inventory/vultr.py @@ -85,7 +85,7 @@ 'SUBID': dict(key='id'), 'label': dict(key='name'), 'date_created': dict(), - 'allowed_bandwidth_gb': dict(convert_to='int'), + 'allowed_bandwidth_gb': dict(convert_to='float'), 'auto_backups': dict(key='auto_backup_enabled', convert_to='bool'), 'current_bandwidth_gb': dict(), 'kvm_url': dict(), diff --git a/plugins/modules/vultr_server.py b/plugins/modules/vultr_server.py index cc3a592..b423766 100644 --- a/plugins/modules/vultr_server.py +++ b/plugins/modules/vultr_server.py @@ -210,8 +210,8 @@ allowed_bandwidth_gb: description: Allowed bandwidth to use in GB returned: success - type: int - sample: 1000 + type: float + sample: 1000.5 auto_backup_enabled: description: Whether automatic backups are enabled returned: success @@ -359,7 +359,7 @@ def __init__(self, module): 'SUBID': dict(key='id'), 'label': dict(key='name'), 'date_created': dict(), - 'allowed_bandwidth_gb': dict(convert_to='int'), + 'allowed_bandwidth_gb': dict(convert_to='float'), 'auto_backups': dict(key='auto_backup_enabled', convert_to='bool'), 'current_bandwidth_gb': dict(), 'kvm_url': dict(), diff --git a/plugins/modules/vultr_server_baremetal.py b/plugins/modules/vultr_server_baremetal.py index 8582df4..279f3d1 100644 --- a/plugins/modules/vultr_server_baremetal.py +++ b/plugins/modules/vultr_server_baremetal.py @@ -152,8 +152,8 @@ allowed_bandwidth_gb: description: Allowed bandwidth to use in GB returned: success - type: int - sample: 1000 + type: float + sample: 1000.5 cost_per_month: description: Cost per month for the server returned: success @@ -271,7 +271,7 @@ def __init__(self, module): 'SUBID': dict(key='id'), 'label': dict(key='name'), 'date_created': dict(), - 'allowed_bandwidth_gb': dict(convert_to='int'), + 'allowed_bandwidth_gb': dict(convert_to='float'), 'current_bandwidth_gb': dict(), 'default_password': dict(), 'internal_ip': dict(), diff --git a/plugins/modules/vultr_server_info.py b/plugins/modules/vultr_server_info.py index 4d84bdc..a2608ac 100644 --- a/plugins/modules/vultr_server_info.py +++ b/plugins/modules/vultr_server_info.py @@ -86,8 +86,8 @@ allowed_bandwidth_gb: description: Allowed bandwidth to use in GB returned: success - type: int - sample: 1000 + type: float + sample: 1000.5 auto_backup_enabled: description: Whether automatic backups are enabled returned: success @@ -232,7 +232,7 @@ def __init__(self, module): "FIREWALLGROUPID": dict(key='firewallgroup', transform=self._get_firewallgroup_name), "SUBID": dict(key='id', convert_to='int'), "VPSPLANID": dict(key='plan', convert_to='int', transform=self._get_plan_name), - "allowed_bandwidth_gb": dict(convert_to='int'), + "allowed_bandwidth_gb": dict(convert_to='float'), 'auto_backups': dict(key='auto_backup_enabled', convert_to='bool'), "cost_per_month": dict(convert_to='float'), "current_bandwidth_gb": dict(convert_to='float'),