grnet/snf-image — pull request #38 by candlerb (2014-05-29 09:50:31+00:00)
Title: Support for putting settings into variants files

This patch allows you to create (say) `/etc/ganeti/snf-image/variants/wheezy.conf` with

~~~
IMG_PASSWD=abc123
IMG_FORMAT=diskdump
IMG_ID=debian_base-7.0-x86_64
IMG_PROPERTIES='{"OSFAMILY":"linux","ROOT_PARTITION":"1","USERS":"root"}'
~~~

then you can create an instance with `-o snf-image+wheezy` without having to provide any -O options on the command line. Any -O options you *do* provide override those in the conf file, so `-O img_passwd=def456` works as expected.

The main change is in ganeti_os_main() so that it reads the variants file *before* parsing the options. This is done by making a separate function ganeti_os_variant(), which is also called from the 'verify' script.