From 65751f2562f98bd7fd0734dc00784e6395d76322 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Fri, 14 Mar 2025 21:55:29 +1300 Subject: samba-tool gpo backup fix --generalize This was broken with commit ce56d336f234febfd4cb3da11dd584842c24ce1d but we didn't notice because the test was already broken. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15829 Signed-off-by: Douglas Bagnall Reviewed-by: Jennifer Sutton --- python/samba/netcmd/gpo.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/samba/netcmd/gpo.py b/python/samba/netcmd/gpo.py index 9c22b03a39e..27293ecb4ee 100644 --- a/python/samba/netcmd/gpo.py +++ b/python/samba/netcmd/gpo.py @@ -1323,9 +1323,11 @@ class cmd_backup(GPOCommand): self.outf.write('\nAttempting to generalize XML entities:\n') entities = cmd_backup.generalize_xml_entities(self.outf, gpodir, gpodir) - import operator - ents = "".join(''.format(ent[1].strip('&;'), ent[0]) \ - for ent in sorted(entities.items(), key=operator.itemgetter(1))) + + ent_list = [(v, k) for k, v in entities.items()] + ent_list.sort() + ents = "".join(f'\n' + for ent, val in ent_list) if ent_file: with open(ent_file, 'w') as f: -- cgit v1.2.3