def get_clonespec_for_valid_snapshot(config_spec, object_ref, reloc_spec, template, vm_):
 moving = True
 if (QUICK_LINKED_CLONE == vm_['snapshot']['disk_move_type']):
  reloc_spec.diskMoveType = QUICK_LINKED_CLONE
 elif (CURRENT_STATE_LINKED_CLONE == vm_['snapshot']['disk_move_type']):
  reloc_spec.diskMoveType = CURRENT_STATE_LINKED_CLONE
 elif (COPY_ALL_DISKS_FULL_CLONE == vm_['snapshot']['disk_move_type']):
  reloc_spec.diskMoveType = COPY_ALL_DISKS_FULL_CLONE
 elif (FLATTEN_DISK_FULL_CLONE == vm_['snapshot']['disk_move_type']):
  reloc_spec.diskMoveType = FLATTEN_DISK_FULL_CLONE
 else:
  moving = False
 if moving:
  return build_clonespec(config_spec, object_ref, reloc_spec, template)
 else:
  return None

def get_clonespec_for_valid_snapshot ( config_spec , object_ref , reloc_spec , template , vm_ ) : moving = True if ( QUICK_LINKED_CLONE == vm_ [ 'snapshot' ] [ 'disk_move_type' ] ) : reloc_spec . diskMoveType = QUICK_LINKED_CLONE elif ( CURRENT_STATE_LINKED_CLONE == vm_ [ 'snapshot' ] [ 'disk_move_type' ] ) : reloc_spec . diskMoveType = CURRENT_STATE_LINKED_CLONE elif ( COPY_ALL_DISKS_FULL_CLONE == vm_ [ 'snapshot' ] [ 'disk_move_type' ] ) : reloc_spec . diskMoveType = COPY_ALL_DISKS_FULL_CLONE elif ( FLATTEN_DISK_FULL_CLONE == vm_ [ 'snapshot' ] [ 'disk_move_type' ] ) : reloc_spec . diskMoveType = FLATTEN_DISK_FULL_CLONE else : moving = False if moving : return build_clonespec ( config_spec , object_ref , reloc_spec , template ) else : return None
return clonespec only if values are valid .