Add sysupgrade state file

When IPA package is being updated, some of the configuration files
are also updated. Sometimes it may be useful to store upgrade meta
information for next package upgrades. For example an information
that some config file was already updated and we don't want to
update it again if user purposedly reverted the change.

This patch adds a new StateFile in /var/lib/ipa/sysupgrade which
is capable of holding this information. New sysupgrade.py module
was created to provide simple API to access the upgrade state
information.
This commit is contained in:
Martin Kosek
2012-06-10 21:23:10 -04:00
committed by Rob Crittenden
parent 4507dcda58
commit c856fb6073
5 changed files with 91 additions and 13 deletions
+4
View File
@@ -48,6 +48,7 @@ from ipaserver.install import ntpinstance
from ipaserver.install import certs
from ipaserver.install import cainstance
from ipaserver.install import memcacheinstance
from ipaserver.install import sysupgrade
from ipaserver.install import service, installutils
from ipapython import version
@@ -495,6 +496,9 @@ def uninstall():
except CalledProcessError, e:
print >>sys.stderr, "Failed to set this machine hostname back to %s (%s)." % (old_hostname, str(e))
# remove upgrade state file
sysupgrade.remove_upgrade_file()
if fstore.has_files():
root_logger.error('Some files have not been restored, see /var/lib/ipa/sysrestore/sysrestore.index')
has_state = False