Merge ~ajorgens/cloud-init:octal-modes into cloud-init:master
| Status: | Merged |
|---|---|
| Approved by: | Scott Moser on 2017-06-14 |
| Approved revision: | 2f7132a0fa8ae12f9771b5e3c44f93ef1685ea75 |
| Merged at revision: | 0fe6a0607408d387f4b0d4482b95afbc5d3f3909 |
| Proposed branch: | ~ajorgens/cloud-init:octal-modes |
| Merge into: | cloud-init:master |
| Diff against target: |
146 lines (+52/-9) 6 files modified
cloudinit/config/cc_write_files.py (+9/-1) cloudinit/util.py (+5/-1) tests/unittests/helpers.py (+5/-3) tests/unittests/test_datasource/test_azure.py (+2/-1) tests/unittests/test_handler/test_handler_ntp.py (+2/-1) tests/unittests/test_handler/test_handler_write_files.py (+29/-2) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Scott Moser | 2017-06-09 | Approve on 2017-06-14 | |
| Server Team CI bot | continuous-integration | Approve on 2017-06-12 | |
| Chad Smith | 2017-06-12 | Approve on 2017-06-12 | |
| Andrew Jorgensen (community) | Resubmit on 2017-06-12 | ||
|
Review via email:
|
|||
Commit Message
write_file(s): Print file modes as octal, not decimal
Unix file modes are usually represented as octal, but they were being
interpreted as decimal, for example 0o644 would be printed as '420'.
| Andrew Jorgensen (ajorgens) wrote : | # |
Well, dang, I thought this was going to be the easy one to get merged. Why is the mode None? *sigh*
| Scott Moser (smoser) wrote : | # |
Andrew,
Thanks for re-submitting this MP.
I've reviewed a little bit and found a few things
a.) as seen in the c-i logs, the change to 'decode_perms' can fail if the input was a string.
>>> "%o" % "0755"
TypeError: %o format: an integer is required, not str
b.) it seems to have exposed an error in append_file() that i'm not sure how it ever worked.
For your MP to be accepted, we need to fix 'a'
I've put a suggested change like:
http://
Basically that just tries to do '%o' but uses '%r' if that fails.
Thoughts?
- 5a9acd1... by Andrew Jorgensen on 2017-06-12
PASSED: Continuous integration, rev:
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
Thanks, this looks good to me.
I'm asking Chad for a quick review also.
PASSED: Continuous integration, rev:5a9acd19162
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Chad Smith (chad.smith) wrote : | # |
Looks good and thanks for the unit tests. Since we now have a with_logs option in CiTest class, let's use that instead of mocks.
Here's a slight extension to our unit test logging setup to also make sure we check log level on some of these logs.
http://
Approved if folks think this is a good idea with the following patch.
- 2f7132a... by Andrew Jorgensen on 2017-06-12
| Andrew Jorgensen (ajorg) wrote : | # |
Ready to merge AFAICT.
PASSED: Continuous integration, rev:2f7132a0fa8
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
I approve this.
We really ought to change the signature of decode_perms to not take a 'log' input but rather just to use logging.
Andrew, interested in doing a follow up for that?
| Andrew Jorgensen (ajorgens) wrote : | # |
> Andrew, interested in doing a follow up for that?
Probably. I've got a rather long queue of patches to post, but I've added this to the TODO list.


FAILED: Continuous integration, rev:93c6d05f219 5d141ad71ea6349 92ad457472900b /code.launchpad .net/~ajorgens/ cloud-init/ +git/cloud- init/+merge/ 325424/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
https:/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 509/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- amd64/509/ console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- arm64/509/ console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- ppc64el/ 509/console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- s390x/509/ console /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=vm- i386/509/ console
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 509/rebuild
https:/