From: Douglas Bagnall Date: Thu, 7 Jan 2021 03:14:45 +0000 (+1300) Subject: samba-tool: domain tombstones expunge reminds on semi-noop X-Git-Tag: tevent-0.11.0~1466 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17c14a4553558347e0edbfe6b06f96eddaa7ca4f;p=thirdparty%2Fsamba.git samba-tool: domain tombstones expunge reminds on semi-noop Sometimes people assume `samba-tool domain tombstones expunge` will expunge tombstones, but in the general case it won't because it only affects those that have reached the tombstone lifetime, but these are likely to have already been deleted by the regularly scheduled task. You need to set the tombstone lifetime to have much effect. This patch doesn't change the behaviour, but it does warn the user that they are probably doing nothing of significance. Signed-off-by: Douglas Bagnall Reviewed-by: Jeremy Allison --- diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index 6a02b2ecac0..ffabe8098c0 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -3822,6 +3822,13 @@ This command expunges tombstones from the database.""" samdb = SamDB(url=H, session_info=system_session(), credentials=creds, lp=lp) + if current_time_string is None and tombstone_lifetime is None: + print("Note: without --current-time or --tombstone-lifetime " + "only tombstones already scheduled for deletion will " + "be deleted.", file=self.outf) + print("To remove all tombstones, use --tombstone-lifetime=0.", + file=self.outf) + if current_time_string is not None: current_time_obj = time.strptime(current_time_string, "%Y-%m-%d") current_time = int(time.mktime(current_time_obj))