Merge ~jcastets/cloud-init:scaleway-datasource into cloud-init:master
| Status: | Merged |
|---|---|
| Approved by: | Scott Moser on 2017-07-17 |
| Approved revision: | f61323fb96a58688be73566eaa30c8f7c3b3adc6 |
| Merged at revision: | e80517ae6aea49c9ab3bd622a33fee44014f485f |
| Proposed branch: | ~jcastets/cloud-init:scaleway-datasource |
| Merge into: | cloud-init:master |
| Diff against target: |
561 lines (+510/-3) 4 files modified
cloudinit/sources/DataSourceScaleway.py (+223/-0) cloudinit/url_helper.py (+8/-2) tests/unittests/test_datasource/test_scaleway.py (+262/-0) tools/ds-identify (+17/-1) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Chad Smith | Approve on 2017-07-17 | ||
| Scott Moser | 2017-06-15 | Approve on 2017-07-17 | |
| Server Team CI bot | continuous-integration | Approve on 2017-07-17 | |
|
Review via email:
|
|||
Description of the Change
Implements Scaleway datasource with user and vendor data.
| Scott Moser (smoser) wrote : | # |
Some things, and some content inline:
* We'll need some unit tests for this. Otherwise it is at increased risk of being inadvertently broken.
* We will need to add knowledge of the datasource to tools/ds-identify (without that your datasource will only ever be considered if it is a single entry in the configured list)
* we really, *REALLY* want a positive non-network identification. Without such a thing, we can't enable the datasource by default, meaning Ubuntu or other images that would work elsewhere wont work on your platform.
Also, give a nicer commit message:
Summary
<blank line>
More information
...
<blank line>
LP: #XXXXXXX
PASSED: Continuous integration, rev:a0748674f74
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 : | # |
over all nice.
some comments.
thank you, Julien.
| Scott Moser (smoser) wrote : | # |
I'm going to move this to 'work in progress'
Please address the comments / tests and move it back to 'Needs Review'.
| Julien Castets (jcastets) wrote : | # |
Everything should be fixed.
* I updated the header of cloudinit/
* on_scaleway doesn't rely on network anymore. It checks if "scaleway" is in /var/run/scaleway, in the commandline, or in DMI data.
* Made some unittests
* requests.requests creates a requests.Session object and calls session.request: https:/
If you need any precision or change, feel free to ask.
Since the datasource no longer makes network requests, is there a chance to enable it by default?
Thanks,
FAILED: Continuous integration, rev:2d3032a34fd
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:174de3110c0
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:edea9c27ba5
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:44618aa9204
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:e53e67513c6
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 : | # |
Some comments inline. mostly questions.
Would it be easier for you to use requests directly rather than going through urlhelper ?
- c8201d5... by Julien Castets on 2017-07-12
- 55eb390... by Julien Castets on 2017-07-12
- c28b9e4... by Julien Castets on 2017-07-12
- f52c323... by Julien Castets on 2017-07-12
- 80be5ac... by Julien Castets on 2017-07-12
- 3fddcf0... by Julien Castets on 2017-07-12
| Julien Castets (jcastets) wrote : | # |
> Some comments inline. mostly questions.
Everything should be fixed. I can rebase my commits into one if you want me to.
> Would it be easier for you to use requests directly rather than going through
> urlhelper ?
I'd prefer not to. url_helper is doing some logging, sets the user-agent, gracefully handles SSL errors... even if it seems hackish, using url_helper.readurl is IMO the best way to do.
PASSED: Continuous integration, rev:3fddcf07e44
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: CentOS 6 & 7: Build & Test
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
- f61323f... by Julien Castets on 2017-07-17
PASSED: Continuous integration, rev:f61323fb96a
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: CentOS 6 & 7: Build & Test
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
I approve of this at this point.
The use of urllib3 through requests could be a problem in the future, but
should not cause any regression potential here as this is a new
datasource.
I plan on adding the additional changes at
http://
Just for our future reference / context.
| Chad Smith (chad.smith) wrote : | # |
Unit test decomposition looks good; thank you for that. I'd avoid wrapper functions in the future like install_mocks just so we can see mocked return_values are seen local to the unit test instead of having to look up at another method defintion to find out what it really is set to. I get that in this case it gives and easy eye in the 3 unit tests toward reading the True,False flags for whether the mock is 'active'.
Per the content of the merge proposal, the altered readurl in cloudinit.
Approved with Scott's comments for context and s/priviledged/
| Julien Castets (jcastets) wrote : | # |
Thanks a lot for your help :)


PASSED: Continuous integration, rev:adfca12743e 2dd78ac1ad7f832 53f41c06eb3795 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 536/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- amd64/536 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- arm64/536 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- ppc64el/ 536 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- s390x/536 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=vm- i386/536
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 536/rebuild
https:/