<s> from pyVmomi import vim <EOL> from vmwarelib . actions import BaseAction <EOL> class RemoveVM ( BaseAction ) : <EOL> def run ( self , vm , delete_permanently ) : <EOL> si = self . si <EOL> vm_obj = vim . VirtualMachine ( vm , stub = si . _stub ) <EOL> if delete_permanently : <EOL> task = vm_obj . Destroy_Task ( ) <EOL> success = self . _wait_for_task ( task ) <EOL> else : <EOL> vm_obj . UnregisterVM ( ) <EOL> success = True <EOL> return { "<STR_LIT:success>" : success } </s>
