def _create_snapshot_metadata(self, base, instance, img_fmt, snp_name):
    metadata = {'is_public': False, 'status': 'active', 'name': snp_name, 'properties': {'kernel_id': instance['kernel_id'], 'image_location': 'snapshot', 'image_state': 'available', 'owner_id': instance['project_id'], 'ramdisk_id': instance['ramdisk_id']}}
    if instance['os_type']:
        metadata['properties']['os_type'] = instance['os_type']
    if (base.get('disk_format') == 'ami'):
        metadata['disk_format'] = 'ami'
    else:
        metadata['disk_format'] = img_fmt
    metadata['container_format'] = base.get('container_format', 'bare')
    return metadata
def _create_snapshot_metadata(self, base, instance, img_fmt, snp_name):
    metadata = {'is_public': False, 'status': 'active', 'name': snp_name, 'properties': {'kernel_id': instance['kernel_id'], 'image_location': 'snapshot', 'image_state': 'available', 'owner_id': instance['project_id'], 'ramdisk_id': instance['ramdisk_id']}}
    if instance['os_type']:
        metadata['properties']['os_type'] = instance['os_type']
    if (base.get('disk_format') == 'ami'):
        metadata['disk_format'] = 'ami'
    else:
        metadata['disk_format'] = img_fmt
    metadata['container_format'] = base.get('container_format', 'bare')
    return metadata