Fix for dns4 empty setting (#30757)

This fix check if DNS4 is None or not before proceeding with
other operations. Also, added unit test for this change.

Signed-off-by: Fedor Sumkin <qosys.net@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Fedor Sumkin 2017-12-20 10:18:22 +03:00 committed by Abhijeet Kasurde
commit 8a9865cb10
3 changed files with 45 additions and 1 deletions

View file

@ -556,7 +556,7 @@ class Nmcli(object):
self.type = module.params['type']
self.ip4 = module.params['ip4']
self.gw4 = module.params['gw4']
self.dns4 = ' '.join(module.params['dns4'])
self.dns4 = ' '.join(module.params['dns4']) if module.params.get('dns4') else None
self.ip6 = module.params['ip6']
self.gw6 = module.params['gw6']
self.dns6 = module.params['dns6']