From dc556ed7dfca34c356c7efcfcda39db9c3108a8b Mon Sep 17 00:00:00 2001 From: Martin Sivak Date: Tue, 26 Mar 2013 15:54:13 +0100 Subject: Do not execute 'old' ksdata and save the resulting ks to file in /root --- initial_setup/__main__.py | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'initial_setup') diff --git a/initial_setup/__main__.py b/initial_setup/__main__.py index d240758..942b3a4 100644 --- a/initial_setup/__main__.py +++ b/initial_setup/__main__.py @@ -91,20 +91,33 @@ ret = ui.run() if ret == False: sys.exit(0) -# Print the kickstart file -# print data +# Do not execute sections that were part of the original +# anaconda kickstart file (== have .seen flag set) -data.keyboard.execute(None, data, None) -data.lang.execute(None, data, None) +sections = [data.keyboard, data.lang] -# data.selinux.execute(None, data, None) -# data.firewall.execute(None, data, None) -# data.timezone.execute(None, data, None) +# data.selinux +# data.firewall +# data.timezone +for section in sections: + if section.seen: + continue + section.execute(None, data, None) + +# Prepare the user database tools u = Users() -data.group.execute(None, data, None, u) -data.user.execute(None, data, None, u) -data.rootpw.execute(None, data, None, u) + +sections = [data.group, data.user, data.rootpw] +for section in sections: + if section.seen: + continue + section.execute(None, data, None, u) # Configure all addons data.addons.execute(None, data, None, u) + +# Print the kickstart data to file +with open("/root/initial-setup-ks.cfg", "w") as f: + f.write(str(data)) + -- cgit