From 9b96585085e1280364224d7a19708318d77239fc Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Sun, 10 Jul 2016 23:22:03 +0100 Subject: [PATCH] Handle empty IPS publishers (#2047) It turns out it's possible to set up a publisher with no URIs. Handle this gracefully. --- lib/ansible/modules/extras/packaging/os/pkg5_publisher.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/packaging/os/pkg5_publisher.py b/lib/ansible/modules/extras/packaging/os/pkg5_publisher.py index 75c43c6c78..0dd3b5112d 100644 --- a/lib/ansible/modules/extras/packaging/os/pkg5_publisher.py +++ b/lib/ansible/modules/extras/packaging/os/pkg5_publisher.py @@ -179,13 +179,14 @@ def get_publishers(module): publishers[name]['origin'] = [] publishers[name]['mirror'] = [] - publishers[name][values['type']].append(values['uri']) + if values['type'] is not None: + publishers[name][values['type']].append(values['uri']) return publishers def unstringify(val): - if val == "-": + if val == "-" or val == '': return None elif val == "true": return True