summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/ipa_restore.py
diff options
context:
space:
mode:
authorDavid Kupka <dkupka@redhat.com>2015-01-11 18:45:11 -0500
committerJan Cholasta <jcholast@redhat.com>2015-01-13 15:01:31 +0000
commitb6c58ff238eb335dcb2a80fc98ecfe8bce5e2422 (patch)
tree77542bced1054416a06a4c5f67b885ad258e804d /ipaserver/install/ipa_restore.py
parentb0f412177fd36e81e71bea63b8923825c7ab28dd (diff)
downloadfreeipa-b6c58ff238eb335dcb2a80fc98ecfe8bce5e2422.tar.gz
freeipa-b6c58ff238eb335dcb2a80fc98ecfe8bce5e2422.tar.xz
freeipa-b6c58ff238eb335dcb2a80fc98ecfe8bce5e2422.zip
Abort backup restoration on not matching host.
When restoring backup on master other than it was created there is high risk of unexpected and hard-to-debug behavior. Refuse such restore. https://fedorahosted.org/freeipa/ticket/4823 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/install/ipa_restore.py')
-rw-r--r--ipaserver/install/ipa_restore.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
index 46ac856f1..5db65dd05 100644
--- a/ipaserver/install/ipa_restore.py
+++ b/ipaserver/install/ipa_restore.py
@@ -248,11 +248,9 @@ class Restore(admintool.AdminTool):
(options.instance or options.backend)):
raise admintool.ScriptError('Restore must be in data-only mode when restoring a specific instance or backend.')
if self.backup_host != api.env.host:
- self.log.warning('Host name %s does not match backup name %s' %
+ raise admintool.ScriptError(
+ 'Host name %s does not match backup name %s' %
(api.env.host, self.backup_host))
- if (not options.unattended and
- not user_input("Continue to restore?", False)):
- raise admintool.ScriptError("Aborted")
if self.backup_ipa_version != str(version.VERSION):
self.log.warning(
"Restoring data from a different release of IPA.\n"