qubes_create.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/usr/bin/python2 -O
  2. # vim: fileencoding=utf-8
  3. #
  4. # The Qubes OS Project, https://www.qubes-os.org/
  5. #
  6. # Copyright (C) 2015 Joanna Rutkowska <joanna@invisiblethingslab.com>
  7. # Copyright (C) 2015 Wojtek Porczyk <woju@invisiblethingslab.com>
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; either version 2 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License along
  20. # with this program; if not, write to the Free Software Foundation, Inc.,
  21. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  22. #
  23. '''qvm-create - Create new Qubes OS store'''
  24. # TODO allow to set properties and create domains
  25. import sys
  26. import qubes
  27. import qubes.tools
  28. parser = qubes.tools.QubesArgumentParser(
  29. description='Create new Qubes OS store.',
  30. want_app=True,
  31. want_app_no_instance=True)
  32. parser.add_argument('--property', '--prop', '-p',
  33. action=qubes.tools.PropertyAction,
  34. help='set global property')
  35. def main(args=None):
  36. '''Main routine of :program:`qubes-create`.
  37. :param list args: Optional arguments to override those delivered from \
  38. command line.
  39. '''
  40. args = parser.parse_args(args)
  41. qubes.Qubes.create_empty_store(args.app, **args.properties)
  42. return 0
  43. if __name__ == '__main__':
  44. sys.exit(main())