Returns the template format to create a disk in open nebula

    .. versionadded:: 2018.3.0

def _get_device_template(disk, disk_info, template=None):
    '''
    Returns the template format to create a disk in open nebula

    .. versionadded:: 2018.3.0

    '''
    def _require_disk_opts(*args):
        for arg in args:
            if arg not in disk_info:
                raise SaltCloudSystemExit(
                    'The disk {0} requires a {1}\
                    argument'.format(disk, arg)
                )

    _require_disk_opts('disk_type', 'size')

    size = disk_info['size']
    disk_type = disk_info['disk_type']

    if disk_type == 'clone':
        if 'image' in disk_info:
            clone_image = disk_info['image']
        else:
            clone_image = get_template_image(kwargs={'name':
                                                    template})

        clone_image_id = get_image_id(kwargs={'name': clone_image})
        temp = 'DISK=[IMAGE={0}, IMAGE_ID={1}, CLONE=YES,\
                        SIZE={2}]'.format(clone_image, clone_image_id,
                                          size)
        return temp

    if disk_type == 'volatile':
        _require_disk_opts('type')
        v_type = disk_info['type']
        temp = 'DISK=[TYPE={0}, SIZE={1}]'.format(v_type, size)

        if v_type == 'fs':
            _require_disk_opts('format')
            format = disk_info['format']
            temp = 'DISK=[TYPE={0}, SIZE={1}, FORMAT={2}]'.format(v_type,
                                                                  size, format)
        return temp