#NEWLINE# @ factory . post_generation #NEWLINE# def metadata( self , create , extracted , **kwargs ) : #NEWLINE# #INDENT# if ( not create ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# self . metadata = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# cloud = self . backup_source . cloud_project_membership . cloud #NEWLINE# template = self . backup_source . template #NEWLINE# if ( not iaas_models . Image . objects . filter ( cloud = cloud , template = template ) . exists ( ) ) : #NEWLINE# #INDENT# iaas_factories . ImageFactory ( cloud = cloud , template = template ) #NEWLINE# #UNINDENT# self . metadata . update ( { #NEWLINE# #INDENT# 'cloud_project_membership' : self . backup_source . cloud_project_membership . pk , #NEWLINE# 'name' : 'original.vm.name' , #NEWLINE# 'template' : template . pk , #NEWLINE# 'system_snapshot_id' : self . backup_source . system_volume_id , #NEWLINE# 'system_snapshot_size' : self . backup_source . system_volume_size , #NEWLINE# 'data_snapshot_id' : self . backup_source . data_volume_id , #NEWLINE# 'data_snapshot_size' : self . backup_source . data_volume_size , #NEWLINE# 'key_name' : self . backup_source . key_name , #NEWLINE# 'key_fingerprint' : self . backup_source . key_name , #NEWLINE# 'agreed_sla' : self . backup_source . agreed_sla , #NEWLINE# #UNINDENT# } ) #NEWLINE# if extracted : #NEWLINE# #INDENT# self . metadata . update ( extracted )