From 51e2fa20d3b403cf2e5338b3019aa7b4283c4265 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Fri, 19 Aug 2011 09:59:46 +0400 Subject: [PATCH] Add cl_autologin variable for configure autologin. --- pym/cl_fill.py | 9 +++++++++ pym/cl_vars.py | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/pym/cl_fill.py b/pym/cl_fill.py index 066d029..4775ad0 100644 --- a/pym/cl_fill.py +++ b/pym/cl_fill.py @@ -715,3 +715,12 @@ class fillVars(varsShare): def get_cl_ca_path(self): """CA path""" return '/var/calculate/ssl/main' + + def get_cl_autologin(self): + """For livecd get first local non-root user""" + if self.Get('os_root_type') == "livecd": + nonRootUsers = filter(lambda x: x != "root", + self.Get('cl_migrate_user')) + if nonRootUsers: + return nonRootUsers[0] + return "" diff --git a/pym/cl_vars.py b/pym/cl_vars.py index 3194ff8..fed0ab7 100644 --- a/pym/cl_vars.py +++ b/pym/cl_vars.py @@ -88,6 +88,16 @@ class Data: # template file performed at now cl_pass_file = {'hide':True, 'mode':"w"} + """ + cl_autologin: + Available values: "" or username + If variable empty then system will not perform autologin + If variable value is username then dm perform autologin for this user + + Fill: for livecd this variable get first local user (non-root) + """ + cl_autologin = {'hide':True, 'mode':"w"} + # root partition of filesystem os_root_dev = {'hide':True}