From bc0ea200d24c142a28d7e2e5e862160e9230151e Mon Sep 17 00:00:00 2001 From: yanzhangi <51999930+yanzhangi@users.noreply.github.com> Date: Wed, 4 Sep 2019 12:38:25 +0800 Subject: [PATCH] Update ce_bfd_global to fix bugs (#60477) * Update ce_bfd_global to fix bugs (cherry picked from commit c742ce8ee3fefd81237fa584aad067d8992e0596) * Update ce_bfd_global modified information --- changelogs/fragments/60412-ce_bfd_global-to-fix-bugs.yml | 2 ++ lib/ansible/modules/network/cloudengine/ce_bfd_global.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/60412-ce_bfd_global-to-fix-bugs.yml diff --git a/changelogs/fragments/60412-ce_bfd_global-to-fix-bugs.yml b/changelogs/fragments/60412-ce_bfd_global-to-fix-bugs.yml new file mode 100644 index 00000000000..91248dcf7f6 --- /dev/null +++ b/changelogs/fragments/60412-ce_bfd_global-to-fix-bugs.yml @@ -0,0 +1,2 @@ +bugfixes: +- ce_bfd_global - update to fix some bugs - When BFD is unavailable, tosExp and other parameters are sent down to report errors; this error is corrected and the query results are processed again. (https://github.com/ansible/ansible/pull/60412) diff --git a/lib/ansible/modules/network/cloudengine/ce_bfd_global.py b/lib/ansible/modules/network/cloudengine/ce_bfd_global.py index d7b2d11a932..77bedb5e93f 100644 --- a/lib/ansible/modules/network/cloudengine/ce_bfd_global.py +++ b/lib/ansible/modules/network/cloudengine/ce_bfd_global.py @@ -284,7 +284,8 @@ class BfdGlobal(object): glb = root.find("bfd/bfdSchGlobal") if glb: for attr in glb: - bfd_dict["global"][attr.tag] = attr.text + if attr.text is not None: + bfd_dict["global"][attr.tag] = attr.text return bfd_dict