|
|
f65af0 |
From 7f6f620ec43b5606413524d25d3cae1003930f55 Mon Sep 17 00:00:00 2001
|
|
|
f65af0 |
From: Florence Blanc-Renaud <flo@redhat.com>
|
|
|
f65af0 |
Date: Fri, 6 Jul 2018 12:47:34 +0200
|
|
|
f65af0 |
Subject: [PATCH] ipa client uninstall: clean the state store when restoring
|
|
|
f65af0 |
hostname
|
|
|
f65af0 |
|
|
|
f65af0 |
When ipa client was installed with the --hostname= option, it stores
|
|
|
f65af0 |
[network]
|
|
|
f65af0 |
hostname = (current hostname)
|
|
|
f65af0 |
in /var/lib/ipa-client/sysrestore/sysrestore.state and changes the hostname
|
|
|
f65af0 |
from (current hostname) to the value provided in --hostname.
|
|
|
f65af0 |
|
|
|
f65af0 |
During uninstall, the previous hostname is restored but the entry does
|
|
|
f65af0 |
not get removed from sysrestore.state. As the uninstaller checks if all
|
|
|
f65af0 |
entries from sysrestore.state have been restored, it warns that some
|
|
|
f65af0 |
state has not been restored.
|
|
|
f65af0 |
|
|
|
f65af0 |
The fix calls statestore.restore_state() instead of statestore.get_state()
|
|
|
f65af0 |
as this method also clears the entry.
|
|
|
f65af0 |
|
|
|
f65af0 |
https://pagure.io/freeipa/issue/7620
|
|
|
f65af0 |
|
|
|
f65af0 |
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
|
|
|
f65af0 |
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
|
|
|
f65af0 |
---
|
|
|
f65af0 |
ipaplatform/redhat/tasks.py | 2 +-
|
|
|
f65af0 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
f65af0 |
|
|
|
f65af0 |
diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py
|
|
|
f65af0 |
index dcafd735c0161e5cd979ccb113863e7885a14ab3..6a4270defc9f444f76677bdf08d2a680649664bb 100644
|
|
|
f65af0 |
--- a/ipaplatform/redhat/tasks.py
|
|
|
f65af0 |
+++ b/ipaplatform/redhat/tasks.py
|
|
|
f65af0 |
@@ -380,7 +380,7 @@ class RedHatTaskNamespace(BaseTaskNamespace):
|
|
|
f65af0 |
statestore.backup_state('network', 'hostname', old_hostname)
|
|
|
f65af0 |
|
|
|
f65af0 |
def restore_hostname(self, fstore, statestore):
|
|
|
f65af0 |
- old_hostname = statestore.get_state('network', 'hostname')
|
|
|
f65af0 |
+ old_hostname = statestore.restore_state('network', 'hostname')
|
|
|
f65af0 |
|
|
|
f65af0 |
if old_hostname is not None:
|
|
|
f65af0 |
try:
|
|
|
f65af0 |
--
|
|
|
f65af0 |
2.17.1
|
|
|
f65af0 |
|