Merge ~rjschwei/cloud-init:addZyppRepos into cloud-init:master
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Scott Moser on 2017-10-03 | ||||
| Approved revision: | 9485f742ee4083d01d9ad7f50842f628176c58db | ||||
| Merged at revision: | cc1475d07b9d0727012634ee9c7a914d67b051f5 | ||||
| Proposed branch: | ~rjschwei/cloud-init:addZyppRepos | ||||
| Merge into: | cloud-init:master | ||||
| Diff against target: |
502 lines (+467/-1) 4 files modified
cloudinit/config/cc_zypper_add_repo.py (+220/-0) config/cloud.cfg.tmpl (+3/-0) tests/unittests/test_handler/test_handler_zypper_add_repo.py (+237/-0) tests/unittests/test_handler/test_schema.py (+7/-1) |
||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Scott Moser | 2017-09-21 | Approve on 2017-10-03 | |
| Server Team CI bot | continuous-integration | Needs Fixing on 2017-10-03 | |
| Chad Smith | Approve on 2017-10-02 | ||
|
Review via email:
|
|||
Commit Message
suse: Support addition of zypp repos.
This adds support to cloud-config for adding zypp repos.
Description of the Change
Support addition of zypp repos
| Scott Moser (smoser) wrote : | # |
oh, and you'll want to enable the config module in config/
| Scott Moser (smoser) wrote : | # |
Oh, and one other thing:
zypp_repos
Can we make the top level key just 'zypp' (or zypper?) i dont know which is correct, but we're really trying to get to fewer top level keys rather.
zypp:
repos:
stuff.
rather than
zypp_repos:
stuff_here
zypp_config:
stuff here....
| Robert Schweikert (rjschwei) wrote : | # |
> This seems generally fine. And we can take it, but i'd like to do so after the
> 17.1 release.
> I have a few requests:
>
> a.) please add schema (see runcmd as an example). Chad has been workign on
> adding schema in places. It helps docs and general cloud-init usage.
OK, having some trouble to figure out the info needed, what I am missing is the details for
'properties': {....}
> I dont' want to sound rude, thanks for your contribution, and we will get this
> in, just want to do things in the way we're moving to rather than like the
> older code that we're fixing up as we go.
Not rude, thanks for looking at this so quickly especially while you are trying to get out a release. Agreed new code should conform to where everything is going, not to where things have been.
| Robert Schweikert (rjschwei) wrote : | # |
> oh, and you'll want to enable the config module in config/
Yes, now that the tmpl stuff is merged I will rebase and add that. I didn't want to create merg conflict for myself ;)
| Robert Schweikert (rjschwei) wrote : | # |
> Oh, and one other thing:
> zypp_repos
>
> Can we make the top level key just 'zypp' (or zypper?) i dont know which is
> correct, but we're really trying to get to fewer top level keys rather.
> zypp:
> repos:
> stuff...here..
>
> rather than
> zypp_repos:
> stuff_here
> zypp_config:
> stuff here....
zypper would be correct but I don't think I get what you are asking.
| Robert Schweikert (rjschwei) wrote : | # |
> > Oh, and one other thing:
> > zypp_repos
> >
> > Can we make the top level key just 'zypp' (or zypper?) i dont know which is
> > correct, but we're really trying to get to fewer top level keys rather.
> > zypp:
> > repos:
> > stuff...here..
> >
> > rather than
> > zypp_repos:
> > stuff_here
> > zypp_config:
> > stuff here....
>
> zypper would be correct but I don't think I get what you are asking.
Never mind, got it now, duh
- c82c116... by Robert Schweikert on 2017-09-21
- ab3a0e9... by Robert Schweikert on 2017-09-21
| Robert Schweikert (rjschwei) wrote : | # |
@smoser
Can you take another look once the release is out the door. Still need to re-visit the test but I wanted to make sure the code is going in the right direction before I start implementing the test.
FAILED: Continuous integration, rev:ab3a0e90573
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- 3476d6a... by Robert Schweikert on 2017-09-22
| Robert Schweikert (rjschwei) wrote : | # |
Ready for another review.
FAILED: Continuous integration, rev:3476d6ab769
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
just one comment in l ine. and note the bot didn't like something.
i'll review further a bit later.
- d93870a... by Robert Schweikert on 2017-09-24
FAILED: Continuous integration, rev:d93870abb96
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- 4de284c... by Robert Schweikert on 2017-09-26
| Robert Schweikert (rjschwei) wrote : | # |
@smoser OK, one more try, not sure why the style slipped through make style-check. Anyway ready for your review. Any chance you can get to this in the next couple of days? Thanks
FAILED: Continuous integration, rev:4de284ca40c
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
| Robert Schweikert (rjschwei) wrote : | # |
I do not get the test failure, meaning why it shows up in the bot.
Locally:
> flake8 --version
3.3.0 (mccabe: 0.6.1, naming: 0.4.1, pycodestyle: 2.3.1, pyflakes: 1.5.0) CPython 2.7.13 on Linux
> flake8 cloudinit/
returns clean on my machine. My a difference between py3 flake 8 and py 2 flake8?
- b550f2d... by Robert Schweikert on 2017-09-29
FAILED: Continuous integration, rev:b550f2dfd94
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- e4ed9ec... by Robert Schweikert on 2017-09-29
FAILED: Continuous integration, rev:e4ed9ec76a8
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
| Chad Smith (chad.smith) wrote : | # |
Thanks for these branches Robert. Here's a minor set of patches with some of the comments I suggested. I hadn't gotten over to the unit tests yet, but I'm hoping to get that for you tomorrow morning.
Some changes suggested.
http://
| Robert Schweikert (rjschwei) wrote : | # |
If http://
_write_repos call _write_
and having _write_
But as I said, whatever it takes to get it merged and to avoid me carrying a patch in the SUSE package.
- a4d7d5a... by Robert Schweikert on 2017-10-02
FAILED: Continuous integration, rev:a4d7d5adefe
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
| Chad Smith (chad.smith) wrote : | # |
Robert, that's not what it takes to get the approval, but rather a quick set of suggestions/
I admit my quick pass at this review needs validation and/or discussion/
I generally agree on your aversion to the multi-function methods, though there was a tension when I saw the code using configobj but not using configobj.write. It feels like the code was forcing functional separation when the configobj we created can already do this work for us. I don't really know how to resolve that tension, which is why I threw together the hacky patch.
Admitedly, I hadn't looked deeply enough at this branch to get the unit tests passing yet, but there are some things that felt like they rubbed. I had wanted to get you the unrefined pastebin to get the conversation started. I'll spend more time on this this morning when I start my day to see if there is an approach that makes more sense.
| Robert Schweikert (rjschwei) wrote : | # |
I think at this point if we have follow ups for style, refinement lets nail that down in a follow up request. Dito for the tests.
| Chad Smith (chad.smith) wrote : | # |
[1] Couple flakes:
cloudinit/
tests/unittests
[2] Minor tweak on existing unit tests in your setup method, use self.tmp_dir() as you have in other tests and drop the shutil import (and addClennup)
Per any ConfigObj comments, I think we generally have to deal w/ ConfigParser -> ConfigObj moves throughout cloudinit, so we might make any changes related to that at another time.
thanks again for this.
- 9485f74... by Robert Schweikert on 2017-10-03
FAILED: Continuous integration, rev:9485f742ee4
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
changing my review. Thanks for patience Robert. I'll fix your flake8 error, and then make sure this runs in tox and then accept.
Thanks.


This seems generally fine. And we can take it, but i'd like to do so after the 17.1 release.
I have a few requests:
a.) please add schema (see runcmd as an example). Chad has been workign on adding schema in places. It helps docs and general cloud-init usage.
b.) please do less in handle. handle has an annoying interface. and its easier and more direct to unit test if you break portions out.
c.) don't use the 'log' that is passed into handle, instead import and use LOG.<verb> like other modules do. Your usage makes sense, as you copied other modules, we're just moving away from that.
I dont' want to sound rude, thanks for your contribution, and we will get this in, just want to do things in the way we're moving to rather than like the older code that we're fixing up as we go.