This commit is contained in:
2026-02-11 13:50:28 +03:00
parent 8c554c8edd
commit e54a9591e4
44 changed files with 6329 additions and 6756 deletions

View File

@@ -62,6 +62,10 @@ class DecortAccount(DecortController):
name=dict(
type='str',
),
get_resource_consumption=dict(
type='bool',
default=False,
),
quotas=dict(
type='dict',
options=dict(
@@ -71,9 +75,6 @@ class DecortAccount(DecortController):
disks_size=dict(
type='int',
),
ext_traffic=dict(
type='int',
),
gpu=dict(
type='int',
),
@@ -94,7 +95,6 @@ class DecortAccount(DecortController):
'disabled',
'present',
],
default='present',
),
sep_pools=dict(
type='list',
@@ -131,7 +131,7 @@ class DecortAccount(DecortController):
"""
arg_state = self.aparams['state']
if 'absent' in arg_state:
if arg_state is not None and 'absent' in arg_state:
# Parameters or combinations of parameters that can
# cause changing the object.
changing_params = [
@@ -175,6 +175,7 @@ class DecortAccount(DecortController):
if check_error:
self.exit(fail=True)
@DecortController.handle_sdk_exceptions
def run(self):
self.get_info()
self.check_amodule_args_for_change()
@@ -187,6 +188,7 @@ class DecortAccount(DecortController):
self.acc_id, self._acc_info = self.account_find(
account_name=self.aparams['name'],
account_id=self.aparams['id'],
resource_consumption=self.aparams['get_resource_consumption'],
)
# If this is a repeated getting info
else:
@@ -195,6 +197,9 @@ class DecortAccount(DecortController):
if not self.amodule.check_mode:
self.acc_id, self._acc_info = self.account_find(
account_id=self.acc_id,
resource_consumption=(
self.aparams['get_resource_consumption']
),
)
self.facts = self.acc_info
@@ -361,7 +366,6 @@ class DecortAccount(DecortController):
quotas_naming = [
['cpu', 'CU_C', 'cpu_quota'],
['disks_size', 'CU_DM', 'disks_size_quota'],
['ext_traffic', 'CU_NP', 'ext_traffic_quota'],
['gpu', 'gpu_units', 'gpu_quota'],
['public_ip', 'CU_I', 'public_ip_quota'],
['ram', 'CU_M', 'ram_quota'],