ó oBú]c@s;dZddlZddlmZddgZd„ZdS(s‰ Grub Dpkg --------- **Summary:** configure grub debconf installation device Configure which device is used as the target for grub installation. This module should work correctly by default without any user configuration. It can be enabled/disabled using the ``enabled`` config key in the ``grub_dpkg`` config dict. The global config key ``grub-dpkg`` is an alias for ``grub_dpkg``. If no installation device is specified this module will look for the first existing device in: - ``/dev/sda`` - ``/dev/vda`` - ``/dev/xvda`` - ``/dev/sda1`` - ``/dev/vda1`` - ``/dev/xvda1`` **Internal name:** ``cc_grub_dpkg`` **Module frequency:** per instance **Supported distros:** ubuntu, debian **Config keys**:: grub_dpkg: enabled: grub-pc/install_devices: grub-pc/install_devices_empty: grub-dpkg: (alias for grub_dpkg) iÿÿÿÿN(tutiltubuntutdebianc CsÃ|jd|jdiƒƒ}|s-i}n|jdtƒ}tj|ƒre|jd||ƒdStj|ddƒ}tj|ddƒ}tjj dƒr´tjj dƒ sÙtjj d ƒrtjj d ƒ r|dkrîd }n|dkr]d }q]nW|dkrd }n|dkr]d}x-dD]"} tjj | ƒr4| }Pq4q4Wnd||f} |jd||fƒytj dg| ƒWn!t k r¾tj |dƒnXdS(Nt grub_dpkgs grub-dpkgtenableds*%s disabled by config grub_dpkg/enabled=%ssgrub-pc/install_devicessgrub-pc/install_devices_emptys /dev/sda1s/dev/sdas /dev/xvda1s /dev/xvdatttruetfalses/dev/vdas /dev/vda1s[grub-pc grub-pc/install_devices string %s grub-pc grub-pc/install_devices_empty boolean %s s2Setting grub debconf-set-selections with '%s','%s'sdebconf-set-selectionss2Failed to run debconf-set-selections for grub-dpkg(s/dev/sdas/dev/vdas /dev/xvdas /dev/sda1s /dev/vda1s /dev/xvda1( tgettTrueRtis_falsetdebugtget_cfg_option_strtNonetostpathtexiststsubpt Exceptiontlogexc( tnametcfgt_cloudtlogt_argstmycfgRtidevst idevs_emptytdevt dconf_sel((sA/usr/lib/python2.7/site-packages/cloudinit/config/cc_grub_dpkg.pythandle2sB %%            (t__doc__Rt cloudinitRtdistrosR(((sA/usr/lib/python2.7/site-packages/cloudinit/config/cc_grub_dpkg.pyt)s