def findiso(flavor):
 url = isoURLs[flavor]
 name = path.basename(url)
 iso = path.join(VMImageDir, name)
 if ((not path.exists(iso)) or ((stat(iso)[ST_MODE] & 511) != 292)):
  log('* Retrieving', url)
  run(('curl -C - -o %s %s' % (iso, url)))
  result = run(('file ' + iso))
  if (('ISO' not in result) and ('boot' not in result)):
   os.remove(iso)
   raise Exception(('findiso: could not download iso from ' + url))
  log('* Write-protecting iso', iso)
  os.chmod(iso, 292)
 log('* Using iso', iso)
 return iso

def findiso ( flavor ) : url = isoURLs [ flavor ] name = path . basename ( url ) iso = path . join ( VMImageDir , name ) if ( ( not path . exists ( iso ) ) or ( ( stat ( iso ) [ ST_MODE ] & 511 ) != 292 ) ) : log ( '* Retrieving' , url ) run ( ( 'curl -C - -o %s %s' % ( iso , url ) ) ) result = run ( ( 'file ' + iso ) ) if ( ( 'ISO' not in result ) and ( 'boot' not in result ) ) : os . remove ( iso ) raise Exception ( ( 'findiso: could not download iso from ' + url ) ) log ( '* Write-protecting iso' , iso ) os . chmod ( iso , 292 ) log ( '* Using iso' , iso ) return iso
find iso .