It appears that RSAT can leave a space in the gPLink field, which we need to handle.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13564
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
def parse_gplink(gplink):
'''parse a gPLink into an array of dn and options'''
ret = []
+
+ if gplink.strip() == '':
+ return ret
+
a = gplink.split(']')
for g in a:
if not g:
except Exception:
raise CommandError("Container '%s' does not exist" % container_dn)
- if msg['gPLink']:
+ if 'gPLink' in msg and msg['gPLink']:
self.outf.write("GPO(s) linked to DN %s\n" % container_dn)
gplist = parse_gplink(str(msg['gPLink'][0]))
for g in gplist: