diff options
| author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2025-03-14 21:55:29 +1300 |
|---|---|---|
| committer | Douglas Bagnall <dbagnall@samba.org> | 2025-03-25 04:20:45 +0000 |
| commit | 65751f2562f98bd7fd0734dc00784e6395d76322 (patch) | |
| tree | b55e2f77d0be6f57b4d3cb05ab58f418fe34c0d8 /python | |
| parent | 6b619b568f6661d3a5f0701cdfaf1e1e4943ff6f (diff) | |
| download | samba-65751f2562f98bd7fd0734dc00784e6395d76322.tar.gz samba-65751f2562f98bd7fd0734dc00784e6395d76322.tar.bz2 samba-65751f2562f98bd7fd0734dc00784e6395d76322.zip | |
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 <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Diffstat (limited to 'python')
| -rw-r--r-- | python/samba/netcmd/gpo.py | 8 |
1 files changed, 5 insertions, 3 deletions
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('<!ENTITY {} "{}\n">'.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'<!ENTITY {ent.strip("&;")} "{val}">\n' + for ent, val in ent_list) if ent_file: with open(ent_file, 'w') as f: |
