From 2c95c6ef0c6b91c5845050517f6b71425f9a4b7b Mon Sep 17 00:00:00 2001 From: Sergey Shubin svs1370 Date: Tue, 6 Apr 2021 14:49:09 +0300 Subject: [PATCH] Add extra checks for compute data disks management --- module_utils/decort_utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/module_utils/decort_utils.py b/module_utils/decort_utils.py index e3c18ac..49af7ab 100644 --- a/module_utils/decort_utils.py +++ b/module_utils/decort_utils.py @@ -518,8 +518,11 @@ class DecortController(object): # # then all values when entering this method will be of type string. We need to # explicitly cast int type on all of them. - for idx, repair in enumerate(new_data_disks): - new_data_disks[idx] = int(repair) + if new_data_disks is not None: + for idx, repair in enumerate(new_data_disks): + new_data_disks[idx] = int(repair) + else: + new_data_disks = [] for disk in comp_dict['disks']: if disk['type'] == 'B':