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