Blame SOURCES/ansible-freeipa-0.1.6-ipatopologysegment-reinitialized-c212b435_rhbz#1733559.patch

9e975f
From c212b43516cb870bbaa86c607dde33f373768043 Mon Sep 17 00:00:00 2001
9e975f
From: Thomas Woerner <twoerner@redhat.com>
9e975f
Date: Fri, 26 Jul 2019 19:30:11 +0200
9e975f
Subject: [PATCH] ipatopologysegment: Fail for missing entry with reinitialized
9e975f
9e975f
Currently it is ignored if the entry for reinitialized can not be found if
9e975f
the name or left and right are not correct. Now there is a failure in this
9e975f
case.
9e975f
9e975f
Fixes: #107 (Reinitialize are failed to find the node in ipatopology ..)
9e975f
Signed-off-by: Thomas Woerner <twoerner@redhat.com>
9e975f
---
9e975f
 plugins/modules/ipatopologysegment.py | 12 ++++++++++++
9e975f
 1 file changed, 12 insertions(+)
9e975f
9e975f
diff --git a/plugins/modules/ipatopologysegment.py b/plugins/modules/ipatopologysegment.py
9e975f
index e768f72..e506b53 100644
9e975f
--- a/plugins/modules/ipatopologysegment.py
9e975f
+++ b/plugins/modules/ipatopologysegment.py
9e975f
@@ -311,6 +311,18 @@ def main():
9e975f
 
9e975f
                     commands.append(["topologysegment_reinitialize", args,
9e975f
                                      suffix])
9e975f
+                else:
9e975f
+                    params = []
9e975f
+                    if name is not None:
9e975f
+                        params.append("name=%s" % name)
9e975f
+                    if left is not None:
9e975f
+                        params.append("left=%s" % left)
9e975f
+                    if right is not None:
9e975f
+                        params.append("right=%s" % right)
9e975f
+                    ansible_module.fail_json(
9e975f
+                        msg="No entry '%s' for suffix '%s'" %
9e975f
+                        (",".join(params), suffix))
9e975f
+
9e975f
             else:
9e975f
                 ansible_module.fail_json(msg="Unkown state '%s'" % state)
9e975f