diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2018-12-20 15:57:35 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-01-19 19:21:19 +0100 |
commit | 011ee2713f0b5b0236865bc21c171d6e4ce3d108 (patch) | |
tree | 12889374ac7b3cee67255221dd258205db49b366 /python | |
parent | fb0498275690c9477a5c0a7c2da20a3bb29556af (diff) | |
download | samba-011ee2713f0b5b0236865bc21c171d6e4ce3d108.tar.gz |
python/uptodateness: cope with unknown invocation ID
This can happen if a server has been replaced
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/uptodateness.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/python/samba/uptodateness.py b/python/samba/uptodateness.py index 3964bd7d6db..711407e5641 100644 --- a/python/samba/uptodateness.py +++ b/python/samba/uptodateness.py @@ -83,8 +83,13 @@ def get_utdv(samdb, dn): expression=("(&(invocationId=%s)" "(objectClass=nTDSDSA))" % inv_id), attrs=["distinguishedName", "invocationId"]) - settings_dn = str(res[0]["distinguishedName"][0]) - prefix, dsa_dn = settings_dn.split(',', 1) + try: + settings_dn = str(res[0]["distinguishedName"][0]) + prefix, dsa_dn = settings_dn.split(',', 1) + except IndexError as e: + print("Unknown invocation ID %s" % inv_id, + file=sys.stderr) + continue if prefix != 'CN=NTDS Settings': raise CommandError("Expected NTDS Settings DN, got %s" % settings_dn) |