def unregister(name, delete=False):
 nodes = list_nodes_min()
 if (name not in nodes):
  raise CommandExecutionError('The specified VM ({0}) is not registered.'.format(name))
 cmd = '{0} unregistervm {1}'.format(vboxcmd(), name)
 if (delete is True):
  cmd += ' --delete'
 ret = salt.modules.cmdmod.run_all(cmd)
 if (ret['retcode'] == 0):
  return True
 return ret['stderr']

def unregister ( name , delete = False ) : nodes = list_nodes_min ( ) if ( name not in nodes ) : raise CommandExecutionError ( 'The specified VM ({0}) is not registered.' . format ( name ) ) cmd = '{0} unregistervm {1}' . format ( vboxcmd ( ) , name ) if ( delete is True ) : cmd += ' --delete' ret = salt . modules . cmdmod . run_all ( cmd ) if ( ret [ 'retcode' ] == 0 ) : return True return ret [ 'stderr' ]
unregister a vm cli example: .