qvm_remove.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #
  2. # The Qubes OS Project, http://www.qubes-os.org
  3. #
  4. # Copyright (C) 2017 Marek Marczykowski-Górecki
  5. # <marmarek@invisiblethingslab.com>
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU Lesser General Public License as published by
  9. # the Free Software Foundation; either version 2.1 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Lesser General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Lesser General Public License along
  18. # with this program; if not, write to the Free Software Foundation, Inc.,
  19. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  20. #
  21. ''' Remove domains from the system '''
  22. import sys
  23. from qubesadmin.tools import QubesArgumentParser
  24. parser = QubesArgumentParser(description=__doc__,
  25. want_app=True,
  26. vmname_nargs='+')
  27. def main(args=None, app=None): # pylint: disable=missing-docstring
  28. args = parser.parse_args(args, app=app)
  29. for vm in args.domains:
  30. del args.app.domains[vm.name]
  31. return 0
  32. if __name__ == '__main__':
  33. sys.exit(main())