Merge ~redriver/cloud-init:fix-mount-issue-for-frbsd-on-Azure into cloud-init:master
| Status: | Merged |
|---|---|
| Approved by: | Scott Moser on 2017-06-14 |
| Approved revision: | c519fa8eafd8bb9551729da969d5da00df43f1df |
| Merged at revision: | 8a06a1244c8ee20902db050e142c5a0b2fd777a9 |
| Proposed branch: | ~redriver/cloud-init:fix-mount-issue-for-frbsd-on-Azure |
| Merge into: | cloud-init:master |
| Diff against target: |
59 lines (+18/-9) 2 files modified
cloudinit/sources/DataSourceAzure.py (+7/-8) tests/unittests/test_datasource/test_azure.py (+11/-1) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Scott Moser | 2017-06-07 | Approve on 2017-06-14 | |
| Server Team CI bot | continuous-integration | Approve on 2017-06-13 | |
|
Review via email:
|
|||
Description of the Change
FreeBSD: Check whether the CDROM is configured or not
The current method is to attempt to mount the cdrom (/dev/cd0), if it is successful, /dev/cd0 is configured, otherwise, it is not configured. The problem is it forgets to check whether the mounting destination folder is created or not. As a result, mounting attempt failed even if cdrom is ready.
LP: #1696295
PASSED: Continuous integration, rev:195808a04fe
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 : | # |
Hi,
So I think the basic idea here is to attempt to mount the cdrom to verify that there is in fact a cdrom.
Thats not an entirely bad idea, but it seems like it might be sufficient to either:
a.) always add 'dev/cd0' on freebsd and let the code in get_data just attempt to mount, which means we would not be mounting the thing twice.
b.) attempt an 'open' and read of /dev/cd0.
this would be quicker than a mount, and at least on linux the 'open' would fail if the cdrom does not have any disk in it.
ie:
if util.is_FreeBSD():
cdrom_dev = "/dev/cd0"
try:
with open(cdrom_dev) as fp:
except IOError:
pass
| Scott Moser (smoser) wrote : | # |
Would the above work? Tests might have to be adjusted.
Thanks Hongjiang!
Scott
| Scott Moser (smoser) wrote : | # |
One more thing.
I'm going to put this into 'Work in progress'.
Please
a.) implement/test my suggestion (verifying that tests still work)
b.) update your 'Commit message' to be of the right format
Subject Line Here
<blank line>
info about the problem and fix
<blank line>
LP: #1696295
c.) move it back to 'Needs Review'.
Thanks!
| Hongjiang Zhang (redriver) wrote : | # |
> One more thing.
> I'm going to put this into 'Work in progress'.
> Please
> a.) implement/test my suggestion (verifying that tests still work)
> b.) update your 'Commit message' to be of the right format
> Subject Line Here
> <blank line>
> info about the problem and fix
> <blank line>
> LP: #1696295
>
> c.) move it back to 'Needs Review'.
>
> Thanks!
The "open" method works for me. Thanks.
FAILED: Continuous integration, rev:d5f78e4b9d0
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- c519fa8... by Hongjiang Zhang on 2017-06-13
PASSED: Continuous integration, rev:c519fa8eafd
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/


PASSED: Continuous integration, rev:270f4d8b91b a6e31bcbfce9635 1309da7fc6b0ce /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 463/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- amd64/463 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- arm64/463 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- ppc64el/ 463 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- s390x/463 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=vm- i386/463
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/ 463/rebuild
https:/