Add simple test to see if client is already configured

If this ever gets out of sync the user can always remove
/var/lib/ipa-client/sysrestore/*, they just need to understand the
implications.

One potential problem is with certmonger. If you install the client
and then re-install without uninstalling then the subsequent
certificate request by certmonger will fail because it will already
be tracking a certificate in /etc/pki/nssdb of the same nickname and
subject (the old cert).
This commit is contained in:
Rob Crittenden authored and Jason Gerard DeRose committed 2010-05-06 15:17:16 -06:00
1 parent cd5eddd843
commit 3bf7268d74
2 files changed
+12

No files matched your search

@@ -440,6 +440,10 @@ def main():
if options.uninstall: if options.uninstall:
return uninstall(options) return uninstall(options)
if fstore.has_files():
print "IPA client is already configured on this system."
return 1
cli_domain = None cli_domain = None
cli_server = None cli_server = None
cli_realm = None cli_realm = None
+8
View File
@@ -203,6 +203,14 @@ class FileStore:
return True return True
def has_files(self):
"""Return True or False if there are any files in the index
Can be used to determine if a program is configured.
"""
return len(self.files) > 0
class StateFile: class StateFile:
"""A metadata file for recording system state which can """A metadata file for recording system state which can
be backed up and later restored. The format is something be backed up and later restored. The format is something