Merge ~tore.lonoy/cloud-init:hashed-chpasswd-support into cloud-init:master
| Status: | Merged |
|---|---|
| Merged at revision: | 21632972df034c200578e1fbc121a07f20bb8774 |
| Proposed branch: | ~tore.lonoy/cloud-init:hashed-chpasswd-support |
| Merge into: | cloud-init:master |
| Diff against target: |
112 lines (+44/-12) 2 files modified
cloudinit/config/cc_set_passwords.py (+36/-11) doc/examples/cloud-config.txt (+8/-1) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Server Team CI bot | continuous-integration | Needs Fixing on 2017-03-06 | |
| Scott Moser | 2016-11-04 | Needs Fixing on 2016-11-04 | |
|
Review via email:
|
|||
Commit Message
Add support for setting hashed passwords
This change will add support for hashed passwords in cc_set_passwords.
It checks if a password is a hash with this if/regxp statement:
re.match(
chpasswd needs to know if the password is hashed or not, so two lists
is created so chpasswd is feed with the correct one.
Description of the Change
Currently only static or randomly generated passwords are supported,
adding support for hashed passwords enables the user to store password
in they configuration a little more secure then using plain-text.
I have been unable to run all the tests on the change, but I've verified
that it works by running these test manually:
* setting static password
* setting static and random
* setting hashed password
* setting hashed and static password
This is my first commit to any open-source project.
- 6807679... by Tore on 2016-11-08
- fde5f5c... by Tore on 2016-11-08
| Tore (tore.lonoy) wrote : | # |
I've made the changes you requested.
I'm not able to create a unit test, as I really don't know how to do it. I don't see any test written already for setting password for chpasswd, so I'm little out of the blue on where to start.
| Scott Moser (smoser) wrote : | # |
Tore,
Thanks again, and sorry for the delay in getting back here.
In order to take this, you'll need to sign the contributors agreement (https:/
http://
Also, please feel free to ping me in Freenode #cloud-init or /query me, or via email.
Taking a quick look, it looks like cc_spacewalk.py and its tests in unittests/
Please do feel free to reach out, this looks great.
Scott
FAILED: Continuous integration, rev:fde5f5c4788
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
Tore,
I went ahead and modified some of the integration tests to have a test for this.
and then proposed https:/
Can you review that ?
Also, i did nto realize before that you hadn't signed the contributors agreement.
Please do so as described in HACKING.rst
| Tore (tore.lonoy) wrote : | # |
> Tore,
> I went ahead and modified some of the integration tests to have a test for
> this.
> and then proposed https:/
> init/+merge/320986 for merge into your branch.
>
> Can you review that ?
Thanks the tests, didn't realise it what that easy
>
> Also, i did nto realize before that you hadn't signed the contributors
> agreement.
> Please do so as described in HACKING.rst
I've just done so, but I believe I already have signed this. I assume this [0] is the link that should be used ?
| Scott Moser (smoser) wrote : | # |
Ok thanks!
On March 25, 2017 1:20:58 AM EDT, Tore <email address hidden> wrote:
>> Tore,
>> I went ahead and modified some of the integration tests to have a
>test for
>> this.
>> and then proposed
>https:/
>> init/+merge/320986 for merge into your branch.
>>
>> Can you review that ?
>
>Thanks the tests, didn't realise it what that easy
>
>>
>> Also, i did nto realize before that you hadn't signed the
>contributors
>> agreement.
>> Please do so as described in HACKING.rst
>
>I've just done so, but I believe I already have signed this. I assume
>this [0] is the link that should be used ?
>
>[0] https:/
>--
>https:/
>You are reviewing the proposed merge of
>~tore.


this looks good. I marked 'Needs Fixing', just for a few nit picks.
I'd like some sort of unit test too.
The trend for adding unit tests is really to make 'handle' do less and move things into methods and use those methods.