Merge lp:~fcorrea/landscape-client/add-otp-field into lp:~landscape/landscape-client/trunk
Proposed by
Fernando Correa Neto
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Free Ekanayaka | ||||
Approved revision: | 400 | ||||
Merged at revision: | 400 | ||||
Proposed branch: | lp:~fcorrea/landscape-client/add-otp-field | ||||
Merge into: | lp:~landscape/landscape-client/trunk | ||||
Diff against target: |
176 lines (+78/-8) 6 files modified
landscape/broker/config.py (+3/-1) landscape/broker/registration.py (+11/-2) landscape/broker/tests/test_registration.py (+38/-0) landscape/configuration.py (+2/-2) landscape/message_schemas.py (+8/-2) landscape/tests/test_configuration.py (+16/-1) |
||||
To merge this branch: | bzr merge lp:~fcorrea/landscape-client/add-otp-field | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Free Ekanayaka (community) | Approve | ||
Alberto Donato (community) | Approve | ||
Review via email: mp+81783@code.launchpad.net |
Description of the change
This branch adds a optinal OTP field to the REGISTER message so computers can be registered automatically.
To post a comment you must log in.
Nice working, marking needs fixing mainly because of [1].
Thanks!
[1]
+ elif self._config. provisioning_ otp:
+ return True
I think this will make the client try to register again every time it's started. It should be probably
return (not id.secure_id) and self._message_ store.accepts( "register- provisioned- machine" )
the (not id.secure_id) means that the computer has not a secure ID yet (which afair is something that the client get and stores after a successful registration) and self._message_ store.accepts( "register- provisioned- machine" ) ensures that the server actually supports that kind of message (in principle it might be an older server that does not support it yet).
[2]
+ logging. info(u" Queueing message to register with OTP as a"
+ u" provisiong machine.")
I'd suggest s/provisioning/ newly provisioned/
[3]
+ {"otp": Any(String(), Constant(None))})
This should be just
{"otp": String()})
as the client must never send an otp with a None value.
[4]
+ """
+ If the provisioning OTP is specified, there is no need to pass the
+ account name and the computer title.
+ """
This is fine, but I just wanted to remind that in practice what we will do is probably to include the account name and computer title in the configuration file (via debconf), for sake of reference. However I think this code doesn't need to be changed in that case.