ipa_restore: Import only FQDN from ipalib.constants

https://fedorahosted.org/freeipa/ticket/5619

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Timo Aaltonen 2016-03-22 21:05:39 +02:00 committed by Martin Basti
parent e45f7314e1
commit 5b32ffcd1a

View File

@ -27,7 +27,8 @@ import itertools
from six.moves.configparser import SafeConfigParser
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
@ -215,7 +216,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')
@ -278,10 +279,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(