Re: Mandatory user spoke

[email protected] Mon, 02 Oct 2017 13:56:05 +0200
Newsgroups gmane.linux.redhat.anaconda.devel
Message-ID <[email protected]>
Hello,
You should be able to modify the UserSpoke in a similar way how the
Source spoke is working:
https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/ui/gui/s
pokes/installation_source.py#L576
You need to have mandatory and ready properties implemented.
Also if you want to use this only for Initial Setup you can use
environment flag in a similar way how we are using it in the Network
spoke. This will enable you to run the code only inside of Initial
Setup and not in Anaconda.
https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/ui/gui/s
pokes/network.py#L1530
You just replace the ANACONDA_ENVIRON by this:
https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/constant
s.py#L135 (Firstboot is name of InitialSetup, historically reasons)

You can of course hide this spoke and use your addon spoke by
implementing this property:
https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/ui/gui/s
pokes/custom_storage.py#L211
or by changing configuration file /etc/sysconfig/anaconda, you should
be able to find it in Anaconda documentation.
I hope this will help you.
Jirka

On Wed, 2017-08-30 at 23:18 +0300, Cristian Stan wrote:
> Hello all, 
> 
> I have an issue I could not fix by myself so far:
> 
> We have a custom Fedora build. After the base Anaconda install,
> Initial Setup runs with two spokes, one with a custom add-on, and the
> user creation spoke. 
> Our issues are with the default user creation spoke; we should both
> enable by default the 'Make this user administrator' checkbox and
> make the user creation mandatory, so that the setup may not be exited
> without creating a user. I've even tried disabling altogether the
> user creation spoke to be able to run my own user creation add-on.
> I've had no luck so far.
> 
> 
> What I've tried until now:
> 
> To enable by default 'Make this user administrator' I have:
> 
> * modified the 'c_admin' object in user.glade to enable it by default
> * tested separately the 'c_admin' user.glade object in Glade
> Interface Designer (it works, as expected)
> * tested the 'c_admin' modification on 'c_usepassword' (to isolate
> the issue; the same setting for one object does not work for the
> other)
> 
> To make the original user creation spoke in Initial Setup mandatory I
> have:
> 
> * modified the '_checkUsername' method from user.py, class
> 'UserSpoke' (Anaconda sources)
> 
> All the modifications were performed after Anaconda's first stage and
> before running Initial Setup.
> 
> 
> 
> Do you have any ideas about this and how should I proceed?
> 
> 
> Thank you, your help is greatly appreciated!
> 
> Cristian Stan
> 
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

_______________________________________________
Anaconda-devel-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/anaconda-devel-list