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:
fp.read(1024)
devlist.append(cdrom_dev)
except IOError:
pass
--
https://code.launchpad.net/~redriver/cloud-init/+git/cloud-init/+merge/325207
Your team cloud-init commiters is requested to review the proposed merge of
~redriver/cloud-init:fix-mount-issue-for-frbsd-on-Azure into cloud-init:master.
_______________________________________________
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : [email protected]
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help : https://help.launchpad.net/ListHelp