From 35eecf1ccd9436c65e4efcca30b155aaa37e7297 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: Mar 23 2016 09:08:53 +0000 Subject: ipa_restore: Import only FQDN from ipalib.constants https://fedorahosted.org/freeipa/ticket/5619 Reviewed-By: Martin Basti --- diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py index 18479d3..86af5ac 100644 --- a/ipaserver/install/ipa_restore.py +++ b/ipaserver/install/ipa_restore.py @@ -30,7 +30,8 @@ import locale from six.moves.configparser import SafeConfigParser import six -from ipalib import api, errors, constants +from ipalib import api, errors +from ipalib.constants import FQDN from ipapython import version, ipautil, certdb from ipapython.ipautil import run, user_input from ipapython import admintool @@ -218,7 +219,7 @@ class Restore(admintool.AdminTool): self.backup_dir = os.path.join(paths.IPA_BACKUP_DIR, self.backup_dir) self.log.info("Preparing restore from %s on %s", - self.backup_dir, constants.FQDN) + self.backup_dir, FQDN) self.header = os.path.join(self.backup_dir, 'header') @@ -281,10 +282,10 @@ class Restore(admintool.AdminTool): self.log.info("Performing %s restore from %s backup" % (restore_type, self.backup_type)) - if self.backup_host != constants.FQDN: + if self.backup_host != FQDN: raise admintool.ScriptError( "Host name %s does not match backup name %s" % - (constants.FQDN, self.backup_host)) + (FQDN, self.backup_host)) if self.backup_ipa_version != str(version.VERSION): self.log.warning(