From e36622f92616b6982bf875563728dc8cdf97c93c Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Wed, 28 Mar 2012 17:49:09 +1100 Subject: s4-upgradedns: Make sure the attribute exists before accessing it Autobuild-User: Amitay Isaacs Autobuild-Date: Wed Mar 28 10:27:40 CEST 2012 on sn-devel-104 --- source4/scripting/bin/samba_upgradedns | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source4/scripting') diff --git a/source4/scripting/bin/samba_upgradedns b/source4/scripting/bin/samba_upgradedns index 1a42e0c8ce..86172a762d 100755 --- a/source4/scripting/bin/samba_upgradedns +++ b/source4/scripting/bin/samba_upgradedns @@ -379,12 +379,16 @@ if __name__ == '__main__': msg = msgs[0] master_nclist = [] - for nc in msg["msDS-hasMasterNCs"]: - master_nclist.append(nc) + ncs = msg.get("msDS-hasMasterNCs") + if ncs: + for nc in ncs: + master_nclist.append(nc) partial_nclist = [] - for nc in msg["hasPartialReplicaNCs"]: - partial_nclist.append(nc) + ncs = msg.get("hasPartialReplicaNCs") + if ncs: + for nc in ncs: + partial_nclist.append(nc) modified = False for nc in dns_nclist: -- cgit