Merge ~smoser/cloud-init:bug/1715241-openstack-maybe-on-non-intel into cloud-init:master
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Scott Moser on 2017-09-07 | ||||
| Approved revision: | c2637c7cfa67049f69ba0e4260deb98a8b84d81d | ||||
| Merged at revision: | dcbb901cc3e9e888bc8f87e87bdc0ca8436a2baa | ||||
| Proposed branch: | ~smoser/cloud-init:bug/1715241-openstack-maybe-on-non-intel | ||||
| Merge into: | cloud-init:master | ||||
| Diff against target: |
121 lines (+48/-3) 2 files modified
tests/unittests/test_ds_identify.py (+42/-3) tools/ds-identify (+6/-0) |
||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Chad Smith | 2017-09-05 | Approve on 2017-09-07 | |
| Server Team CI bot | continuous-integration | Approve on 2017-09-07 | |
|
Review via email:
|
|||
Commit Message
ds-identify: OpenStack on arch other than intel, identify 'maybe'
OpenStack Nova identifies itself only to Intel guests.
Make ds-identify return 'MAYBE' for OpenStack on non-intel arches.
An unnecessary change here is to rename the 'policy_nodmi' kwarg
to 'policy_no_dmi' in the related unit tests.
LP: #1715241
| Scott Moser (smoser) wrote : | # |
On September 5, 2017 5:20:40 PM EDT, Ryan Harper <email address hidden> wrote:
>
>
>Diff comments:
>
>> diff --git a/tests/
>b/tests/
>> index 1a81a89..c389029 100644
>> --- a/tests/
>> +++ b/tests/
>> @@ -48,6 +54,7 @@ P_SEED_DIR = "var/lib/
>> P_DSID_CFG = "etc/cloud/
>>
>> MOCK_VIRT_IS_KVM = {'name': 'detect_virt', 'RET': 'kvm', 'ret': 0}
>> +MOCK_UNAME_
>0}
>
>why is there 'out' here vs. 'RET' in the other mock?
>
Detect_virt is a function that sets the _RET variable. It has no stdout or stderr. Uname is actually a command that has its stdout and stderr mocked.
| Ryan Harper (raharper) wrote : | # |
It may be more obvious for the MOCK_XXX values always have the same keys (even if they don't use them).
MOCK_VIRT_IS_KVM = {
'name': 'detect_virt',
'out': "",
'err': "",
'RET': "kvm",
'ret': 0
}
| Scott Moser (smoser) wrote : | # |
It might be more obvious, but its more verbose.
Same as calling a function with default arguments.
The default values are filled in via 'write_mock' in call.
the reason that we have 'detect_virt' as a shell function is that the call binary it is wrapping is 'detect-virt', which is not a valid posix shell function name... so we can't just mock it by adding a function (which is what the 'write_mock' function does).
| Chad Smith (chad.smith) wrote : | # |
Ok so this adds a slight cost to non-x86 platforms init-network stage by placing a maybe on OpenStack datasource right? This maybe openstack still won't affect datasources which now run in init-local because they would have already been discovered. So ConfigDrive, Ec2,SmartOS, OpenNebula,DO etc would have already been discovered if their platforms were non-x86.
| Scott Moser (smoser) wrote : | # |
will address chad's comment.
- c2637c7... by Scott Moser on 2017-09-07
| Scott Moser (smoser) wrote : | # |
addressed chad's request.
PASSED: Continuous integration, rev:1722c4b5601
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:c2637c7cfa6
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:7e33dc9d39c c7de7be7cd5306d b12b6c78ed684b /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 256/
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/ 256/rebuild
https:/