diff options
author | Simo Sorce <ssorce@redhat.com> | 2008-03-27 19:01:38 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2008-03-27 19:01:38 -0400 |
commit | aac086582aee79ccf72206faf118e997c623170c (patch) | |
tree | 7c806025ad651531015b62ca806db7a32f55c2a8 /ipa-server/ipa-install | |
parent | b7924139d895c7ebe019fbfc9c85fed3baae642e (diff) | |
download | freeipa-aac086582aee79ccf72206faf118e997c623170c.tar.gz freeipa-aac086582aee79ccf72206faf118e997c623170c.tar.xz freeipa-aac086582aee79ccf72206faf118e997c623170c.zip |
Move sysrestore to ipa-python so it can be used by client scripts too.
Change backup format so files are all in a single directory (no dir
hierarchies) and use an index file so we can save also ownership and
permission info for the restore (and eventually other data later on).
Diffstat (limited to 'ipa-server/ipa-install')
-rw-r--r-- | ipa-server/ipa-install/ipa-server-install | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/ipa-server/ipa-install/ipa-server-install b/ipa-server/ipa-install/ipa-server-install index 8b5c44123..1be1d3c94 100644 --- a/ipa-server/ipa-install/ipa-server-install +++ b/ipa-server/ipa-install/ipa-server-install @@ -46,9 +46,9 @@ import ipaserver.httpinstance import ipaserver.ntpinstance from ipaserver import service -from ipaserver import sysrestore from ipaserver.installutils import * +from ipa import sysrestore from ipa.ipautil import * def parse_options(): @@ -173,7 +173,7 @@ def read_ip_address(host_name): continue print "Adding ["+ip+" "+host_name+"] to your /etc/hosts file" - sysrestore.backup_file("/etc/hosts") + fstore.backup_file("/etc/hosts") hosts_fd = open('/etc/hosts', 'r+') hosts_fd.seek(0, 2) hosts_fd.write(ip+'\t'+host_name+' '+host_name[:host_name.find('.')]+'\n') @@ -292,14 +292,13 @@ def check_dirsrv(): sys.exit(1) def uninstall(): - ipaserver.ntpinstance.NTPInstance().uninstall() - ipaserver.bindinstance.BindInstance().uninstall() + ipaserver.ntpinstance.NTPInstance(fstore).uninstall() + ipaserver.bindinstance.BindInstance(fstore).uninstall() ipaserver.httpinstance.WebGuiInstance().uninstall() - ipaserver.httpinstance.HTTPInstance().uninstall() - ipaserver.krbinstance.KrbInstance().uninstall() + ipaserver.httpinstance.HTTPInstance(fstore).uninstall() + ipaserver.krbinstance.KrbInstance(fstore).uninstall() ipaserver.dsinstance.DsInstance().uninstall() - sysrestore.restore_file("/etc/hosts") - sysrestore.restore_file("/etc/ipa/ipa.conf") + fstore.restore_all_files() return 0 def main(): @@ -321,6 +320,9 @@ def main(): standard_logging_setup("/var/log/ipaserver-install.log", options.debug) print "\nThe log file for this installation can be found in /var/log/ipaserver-install.log" + global fstore + fstore = sysrestore.FileStore('/var/lib/ipa/sysrestore') + if options.uninstall: return uninstall() @@ -454,7 +456,7 @@ def main(): # Configure ntpd if options.conf_ntp: - ntp = ipaserver.ntpinstance.NTPInstance() + ntp = ipaserver.ntpinstance.NTPInstance(fstore) ntp.create_instance() # Create a directory server instance @@ -462,11 +464,11 @@ def main(): ds.create_instance(ds_user, realm_name, host_name, domain_name, dm_password) # Create a kerberos instance - krb = ipaserver.krbinstance.KrbInstance() + krb = ipaserver.krbinstance.KrbInstance(fstore) krb.create_instance(ds_user, realm_name, host_name, domain_name, dm_password, master_password) # Create a HTTP instance - http = ipaserver.httpinstance.HTTPInstance() + http = ipaserver.httpinstance.HTTPInstance(fstore) http.create_instance(realm_name, host_name, domain_name) # Create a Web Gui instance @@ -499,7 +501,7 @@ def main(): ds.change_admin_password(admin_password) # Create the config file - sysrestore.backup_file("/etc/ipa/ipa.conf") + fstore.backup_file("/etc/ipa/ipa.conf") fd = open("/etc/ipa/ipa.conf", "w") fd.write("[defaults]\n") fd.write("server=" + host_name + "\n") |