Esempio n. 1
0
    def post_init(self, custom_args):
        """
        vagrant disk format post initialization method

        store vagrantconfig information provided via custom_args

        :param dict custom_args:
            Contains instance of xml_parse::vagrantconfig

            .. code:: python

                {'vagrantconfig': object}
        """
        if not custom_args or 'vagrantconfig' not in custom_args:
            raise KiwiFormatSetupError(
                'object init requires custom_args hash with a vagrantconfig'
            )

        if not custom_args['vagrantconfig']:
            raise KiwiFormatSetupError(
                'no vagrantconfig provided'
            )

        self.image_format = 'vagrant.libvirt.box'
        self.vagrantconfig = custom_args['vagrantconfig']
Esempio n. 2
0
    def post_init(self, custom_args):
        """
        vagrant disk format post initialization method

        store vagrantconfig information provided via custom_args

        Attributes

        * :attr:`options`
            qemu format conversion options

        * :attr:`image_format`
            disk format name: vagrant
        """
        if not custom_args or 'vagrantconfig' not in custom_args:
            raise KiwiFormatSetupError(
                'object init requires custom_args hash with a vagrantconfig'
            )

        if not custom_args['vagrantconfig']:
            raise KiwiFormatSetupError(
                'no vagrantconfig provided'
            )

        self.image_format = 'vagrant.libvirt.box'
        self.vagrantconfig = custom_args['vagrantconfig']
Esempio n. 3
0
    def post_init(self, custom_args):
        """
        vmdk disk format post initialization method

        Store qemu options as list from custom args dict

        :param dict custom_args: custom qemu arguments dictionary
        """
        ovftype = self.xml_state.get_build_type_machine_section().get_ovftype()
        if ovftype != 'vmware':
            raise KiwiFormatSetupError('Unsupported ovftype %s' % ovftype)
        self.image_format = 'ova'
        self.options = self.get_qemu_option_list(custom_args)
Esempio n. 4
0
    def get_target_file_path_for_format(self, format_name):
        """
        Create target file path name for specified format

        :param string format_name: disk format name

        :return: file path name
        :rtype: string
        """
        if format_name != 'raw':
            if format_name not in Defaults.get_disk_format_types():
                raise KiwiFormatSetupError('unsupported disk format %s' %
                                           format_name)
        return ''.join([
            self.target_dir, '/',
            self.xml_state.xml_data.get_name(), '.' + self.arch,
            '-' + self.xml_state.get_image_version(), '.' + format_name
        ])
Esempio n. 5
0
File: ova.py Progetto: agraf/kiwi
    def post_init(self, custom_args):
        """
        vmdk disk format post initialization method

        Store qemu options as list from custom args dict

        Attributes

        * :attr:`options`
            qemu format conversion options

        * :attr:`image_format`
            disk format name: ova
        """
        ovftype = self.xml_state.get_build_type_machine_section().get_ovftype()
        if ovftype != 'vmware':
            raise KiwiFormatSetupError('Unsupported ovftype %s' % ovftype)
        self.image_format = 'ova'
        self.options = self.get_qemu_option_list(custom_args)