<s> import psphere <EOL> from psphere . client import Client <EOL> from psphere . managedobjects import HostSystem <EOL> client = Client ( "<STR_LIT>" , "<STR_LIT:root>" , "<STR_LIT>" ) <EOL> hosts = HostSystem . all ( client ) <EOL> host = hosts [ <NUM_LIT:0> ] <EOL> db = host . datastoreBrowser <EOL> mor = db . SearchDatastore_Task ( datastorePath = "<STR_LIT>" , <EOL> searchSpec = { "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : { "<STR_LIT>" : True , <EOL> "<STR_LIT>" : True , <EOL> "<STR_LIT>" : True , <EOL> "<STR_LIT>" : True } , <EOL> "<STR_LIT>" : False , <EOL> "<STR_LIT>" : False , <EOL> "<STR_LIT>" : None <EOL> } ) <EOL> while True : <EOL> info = mor . info <EOL> if info . state in [ "<STR_LIT:success>" ] : <EOL> break <EOL> mor . update ( properties = [ "<STR_LIT:info>" ] ) <EOL> result = info . result <EOL> files = result . file <EOL> for file in files : <EOL> print "<STR_LIT>" % ( file . path , file . fileSize ) </s>
