From: David Mulder Date: Tue, 15 May 2018 14:37:08 +0000 (-0600) Subject: gpo: Don't duplicate guids in the apply log X-Git-Tag: ldb-1.5.0~305 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b05b6198a3fa480e7026145bfd0608e41fd3f326;p=thirdparty%2Fsamba.git gpo: Don't duplicate guids in the apply log Signed-off-by: David Mulder Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/gpclass.py b/python/samba/gpclass.py index 391f4345f97..70ab2612f27 100644 --- a/python/samba/gpclass.py +++ b/python/samba/gpclass.py @@ -139,9 +139,11 @@ class gp_log: apply_log = user_obj.find('applylog') if apply_log is None: apply_log = etree.SubElement(user_obj, 'applylog') - item = etree.SubElement(apply_log, 'guid') - item.attrib['count'] = '%d' % (len(apply_log)-1) - item.attrib['value'] = guid + prev = apply_log.find('guid[@value="%s"]' % guid) + if prev is None: + item = etree.SubElement(apply_log, 'guid') + item.attrib['count'] = '%d' % (len(apply_log)-1) + item.attrib['value'] = guid def apply_log_pop(self): ''' Pop a GPO guid from the applylog