summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorTim Beale <timbeale@catalyst.net.nz>2019-01-17 09:41:21 +1300
committerKarolin Seeger <kseeger@samba.org>2019-02-04 09:50:09 +0100
commit26cd687f14d70676c41e038b98551944ebd95356 (patch)
tree5dad105cd14c8e3647cc2d8e007932b0252c0236 /python
parentf088f070b4cb5a18fdb6f819c5857ef325f53033 (diff)
downloadsamba-26cd687f14d70676c41e038b98551944ebd95356.tar.gz
netcmd: Try to improve domain backup error message
I ran this command as non-root by mistake and didn't find the error message particularly helpful. Tweak the error message so it reminds the user that they should be root. Also display the path we're looking for the sam.ldb file in, to give them more clues. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Mon Jan 21 16:34:06 CET 2019 on sn-devel-144 (cherry picked from commit 10e54a095f005c0988a7e5e8a35cea6200197854)
Diffstat (limited to 'python')
-rw-r--r--python/samba/netcmd/domain_backup.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/samba/netcmd/domain_backup.py b/python/samba/netcmd/domain_backup.py
index 4cacf571f3d..4e32b4b9b1c 100644
--- a/python/samba/netcmd/domain_backup.py
+++ b/python/samba/netcmd/domain_backup.py
@@ -1009,8 +1009,9 @@ class cmd_domain_backup_offline(samba.netcmd.Command):
paths = samba.provision.provision_paths_from_lp(lp, lp.get('realm'))
if not (paths.samdb and os.path.exists(paths.samdb)):
- raise CommandError('No sam.db found. This backup ' +
- 'tool is only for AD DCs')
+ logger.error("No database found at {0}".format(paths.samdb))
+ raise CommandError('Please check you are root, and ' +
+ 'are running this command on an AD DC')
check_targetdir(logger, targetdir)