Class: EsxRepository

Inherits:
Repository
  • Object
show all
Defined in:
lib/ovfparse/esx_repository.rb

Instance Method Summary collapse

Instance Method Details

#fetchObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ovfparse/esx_repository.rb', line 16

def fetch
  if protocol.name != "esx4" then 
    return 'error'
  end

  #retrieve data from filesystem
  $cmd = VMWARE_LIBS + "/vminfo.pl --url https://" + url + "/sdk/vimService --fields vmname --folder " + VC_FOLDER + " --username " + VC_USER + " --password " + VC_PASS 

  pipe = IO.popen $cmd
  raw_file_list = pipe.read
  pipe.close
   
  #parse out package list
  package_list = Repository::ESXParse(raw_file_list)
  
  #construct package objects based on results
  return simplePackageConstruction(package_list)
end