def _validate_footer_timestamp(vdi_path):
 check_cmd = ('vhd-util check -n %(vdi_path)s -p' % locals())
 check_proc = make_subprocess(check_cmd, stdout=True, stderr=True)
 (out, err) = finish_subprocess(check_proc, check_cmd, ok_exit_codes=[0, 22])
 first_line = out.splitlines()[0].strip()
 if ('primary footer invalid' in first_line):
  raise Exception(("VDI '%(vdi_path)s' has timestamp in the future, ensure source and destination host machines have time set correctly" % locals()))
 elif (check_proc.returncode != 0):
  raise Exception(("Unexpected output '%(out)s' from vhd-util" % locals()))

def _validate_footer_timestamp ( vdi_path ) : check_cmd = ( 'vhd-util check -n %(vdi_path)s -p' % locals ( ) ) check_proc = make_subprocess ( check_cmd , stdout = True , stderr = True ) ( out , err ) = finish_subprocess ( check_proc , check_cmd , ok_exit_codes = [ 0 , 22 ] ) first_line = out . splitlines ( ) [ 0 ] . strip ( ) if ( 'primary footer invalid' in first_line ) : raise Exception ( ( "VDI '%(vdi_path)s' has timestamp in the future, ensure source and destination host machines have time set correctly" % locals ( ) ) ) elif ( check_proc . returncode != 0 ) : raise Exception ( ( "Unexpected output '%(out)s' from vhd-util" % locals ( ) ) )
this check ensures that the timestamps listed in the vhd footer arent in the future .