← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] lp:~smoser/cloud-init/freebsd-configdrive into lp:cloud-init

 

Review: Needs Fixing

Done some more tests, here's the result:

/usr/local/sbin/ is not in root's PATH, so it can't find blkid. Perhaps we need some sort of which in util.py?

You should probably use:
 platform = system_info()["platform"].lower()

Because of:

  File "/usr/local/lib/python2.7/site-packages/cloud_init-0.7.6-py2.7.egg/cloudinit/util.py", line 1362, in mount_cb
    platform = platform.system.lower()
UnboundLocalError: local variable 'platform' referenced before assignment

Another Traceback:

  File "/usr/local/lib/python2.7/site-packages/cloud_init-0.7.6-py2.7.egg/cloudinit/sources/__init__.py", line 253, in find_source
    if s.get_data():
  File "/usr/local/lib/python2.7/site-packages/cloud_init-0.7.6-py2.7.egg/cloudinit/sources/DataSourceConfigDrive.py", line 83, in get_data
    sync=sync)
  File "/usr/local/lib/python2.7/site-packages/cloud_init-0.7.6-py2.7.egg/cloudinit/util.py", line 1408, in mount_cb
    if not mountpoint:
UnboundLocalError: local variable 'mountpoint' referenced before assignment

Shouldn't you should start with mountpoint = False right after diving into else:?

Another one:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/cloud_init-0.7.6-py2.7.egg/cloudinit/sources/__init__.py", line 253, in find_source
    if s.get_data():
  File "/usr/local/lib/python2.7/site-packages/cloud_init-0.7.6-py2.7.egg/cloudinit/sources/DataSourceConfigDrive.py", line 83, in get_data
    sync=sync)
  File "/usr/local/lib/python2.7/site-packages/cloud_init-0.7.6-py2.7.egg/cloudinit/util.py", line 1411, in mount_cb
    (device, tmpd, exc))
UnboundLocalError: local variable 'exc' referenced before assignment

That exc is undefined in raise MountFailedError(). I just left it out and now it runs fine :)

This is inside system_info()["platform"].lower():

 freebsd-10.0-release-amd64-64bit-elf

That obviously doesn't endswidth("bsd"). I've changed it to beginswidth("freebsd") and now cloud-init runs fine at first-boot and reads/loads the configdrive just fine.

Overall I've done some lazy changes/fixes and in the end, it just proofs it's nothing complicated so that is great news.

What does need some attention is networking, I've configured ifconfig_vtnet0="xxxxDHCP" to keep it from asking for an address but c-i should configure static networking in the case of configdrive. And it's not doing that because for that to happen it expects something specific in /etc/rc.conf which isn't there. Looking over that part of distros/freebsd.py I doubt that code is beeing triggered, or even looking out for the correct proper. I'll have to fix that: configdrive scenario's depend heavily on static networking beeing configured by c-i.

-- 
https://code.launchpad.net/~smoser/cloud-init/freebsd-configdrive/+merge/235512
Your team cloud init development team is requested to review the proposed merge of lp:~smoser/cloud-init/freebsd-configdrive into lp:cloud-init.


References