From 3bf7268d749f869d1d238caf2ee9a6c28ed40280 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 6 May 2010 16:41:59 -0400 Subject: 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). --- ipapython/sysrestore.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ipapython') diff --git a/ipapython/sysrestore.py b/ipapython/sysrestore.py index d3c7a501..cad6c91f 100644 --- a/ipapython/sysrestore.py +++ b/ipapython/sysrestore.py @@ -203,6 +203,14 @@ class FileStore: 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: """A metadata file for recording system state which can be backed up and later restored. The format is something -- cgit