Merge ~smoser/cloud-init:bug/1715128-ec2-used-on-openstack into cloud-init:master
| Status: | Merged |
|---|---|
| Approved by: | Scott Moser on 2017-09-07 |
| Approved revision: | d99b689afe584c44018d55b0c26ebfda4f2a6dfa |
| Merged at revision: | 922c3c5c1a86f2d58e95a328e72b49a3bb234ca8 |
| Proposed branch: | ~smoser/cloud-init:bug/1715128-ec2-used-on-openstack |
| Merge into: | cloud-init:master |
| Diff against target: |
152 lines (+60/-12) 2 files modified
cloudinit/sources/DataSourceEc2.py (+35/-8) tests/unittests/test_datasource/test_ec2.py (+25/-4) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Ryan Harper | Approve on 2017-09-07 | ||
| Server Team CI bot | continuous-integration | Approve on 2017-09-07 | |
| Chad Smith | 2017-09-07 | Approve on 2017-09-07 | |
|
Review via email:
|
|||
Commit Message
Ec2: only attempt to operate at local mode on known platforms.
This change makes the DataSourceEc2Local do nothing unless it is on
actual AWS platform. The motivation is twofold:
a.) It is generally safer to only make this function available to Ec2
clones that explicitly identify themselves to the guest. (It also
gives them a reason to supply identification code to cloud-init.)
b.) On non-intel OpenStack platforms ds-identify would enable both the Ec2
and OpenStack sources. That is because there is not good data (such as
dmi) to positively identify the platform. Previously that would be fine
as OpenStack would run first and be successful. The change to add Ec2Local
meant that an Ec2 now runs first.
The best case for 'b' would be a slow down as attempts at the Ec2 metadata
service time out. The discovered case was worse.
Additionally we add a simple check for datatype of 'network' in the
metadata before attempting to read it.
LP: #1715128
| Scott Moser (smoser) wrote : | # |
This will return ec2 to being searched after openstack.
but there are still a couple things i have to think about the stack trace a bit.
- a0ef705... by Scott Moser on 2017-09-07
- 2eea4ec... by Scott Moser on 2017-09-07
- c65d1e0... by Scott Moser on 2017-09-07
FAILED: Continuous integration, rev:c65d1e0e7ec
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- 5e2ce57... by Scott Moser on 2017-09-07
| Chad Smith (chad.smith) wrote : | # |
+1 with a unit test here http://
- d99b689... by Scott Moser on 2017-09-07
PASSED: Continuous integration, rev:5e2ce5724fa
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:d99b689afe5
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
| Ryan Harper (raharper) wrote : | # |
I'm OK with the current approach of blowing up; but I'd like to see a follow up on validating that the config after conversion has a change of doing something useful.
| Scott Moser (smoser) wrote : | # |
ok. given the approve aboev i'm going to pull this
http://
that patch there has a bit more strict checking, but falling back rathe rthan raising a value error means "hiding" this error.
so i'm leaving it as it is right now.


PASSED: Continuous integration, rev:b4d4faa09cb 822ca7124d90da7 e78a5af4ad8abd /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 264/
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 264/rebuild
https:/