summaryrefslogtreecommitdiffstats
path: root/ipaplatform/base/tasks.py
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2016-04-19 18:36:32 +0200
committerMartin Basti <mbasti@redhat.com>2016-04-26 14:01:42 +0200
commitc5686295f14c955d34d9598ddb80b30cb9df663c (patch)
tree5421aa91c6f5d645e7d9cbeff8fb4378a34577f7 /ipaplatform/base/tasks.py
parent14ee02dcbd6cbb6c221ac7526e471a9fc58fcc82 (diff)
downloadfreeipa-c5686295f14c955d34d9598ddb80b30cb9df663c.tar.gz
freeipa-c5686295f14c955d34d9598ddb80b30cb9df663c.tar.xz
freeipa-c5686295f14c955d34d9598ddb80b30cb9df663c.zip
Always set hostname
This prevents cases when hostname on system is set inconsistently (transient and static hostname differs) and may cause IPA errors. This commit ensures that all hostnames are set properly. https://fedorahosted.org/freeipa/ticket/5794 Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaplatform/base/tasks.py')
-rw-r--r--ipaplatform/base/tasks.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/ipaplatform/base/tasks.py b/ipaplatform/base/tasks.py
index f5fb2b155..7c3008863 100644
--- a/ipaplatform/base/tasks.py
+++ b/ipaplatform/base/tasks.py
@@ -48,7 +48,7 @@ class BaseTaskNamespace(object):
def backup_and_replace_hostname(self, fstore, statestore, hostname):
"""
Backs up the current hostname in the statestore (so that it can be
- restored by the restore_network_configuration platform task).
+ restored by the restore_hostname platform task).
Makes sure that new hostname (passed via hostname argument) is set
as a new pemanent hostname for this host.
@@ -106,7 +106,7 @@ class BaseTaskNamespace(object):
return
- def restore_network_configuration(self, fstore, statestore):
+ def restore_hostname(self, fstore, statestore):
"""
Restores the original hostname as backed up in the
backup_and_replace_hostname platform task.
@@ -237,6 +237,14 @@ class BaseTaskNamespace(object):
"""
return parse_version(version)
+ def set_hostname(self, hostname):
+ """
+ Set hostname for the system
+
+ No return value expected, raise CalledProcessError when error occurred
+ """
+ return
+
def configure_httpd_service_ipa_conf(self):
"""Configure httpd service to work with IPA"""
raise NotImplementedError()