From ef4d7d7f2c6faa4d755d2da9d5f0fd88c9f81c09 Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Sat, 10 Apr 2021 13:08:56 +0530 Subject: [PATCH] mgr/nfs: Check if transport or protocol are list instance MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is to fix "int object is not iterable” error. Signed-off-by: Varsha Rao --- src/pybind/mgr/nfs/export/export_utils.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/nfs/export/export_utils.py b/src/pybind/mgr/nfs/export/export_utils.py index e7a9343d10501..2cfe00f8220b2 100644 --- a/src/pybind/mgr/nfs/export/export_utils.py +++ b/src/pybind/mgr/nfs/export/export_utils.py @@ -261,6 +261,14 @@ class Export: client_blocks = [b for b in export_block['_blocks_'] if b['block_name'] == "CLIENT"] + protocols = export_block.get('protocols') + if not isinstance(protocols, list): + protocols = [protocols] + + transports = export_block.get('transports') + if not isinstance(transports, list): + transports = [transports] + return cls(export_block['export_id'], export_block['path'], cluster_id, @@ -268,8 +276,8 @@ class Export: export_block['access_type'], export_block['squash'], export_block['security_label'], - export_block['protocols'], - export_block['transports'], + protocols, + transports, CephFSFSal.from_fsal_block(fsal_block[0]), [Client.from_client_block(client) for client in client_blocks]) -- 2.39.5