Package commands :: Module drop_chroot
[hide private]
[frames] | no frames]

Source Code for Module commands.drop_chroot

 1  import click 
 2   
 3  from coprs import exceptions 
 4  from coprs import db 
 5  from coprs.logic import coprs_logic 
 6  from commands.create_chroot import print_invalid_format 
 7  from commands.create_chroot import print_doesnt_exist 
 8   
 9   
10  @click.command() 
11  @click.option( 
12      "--chroot", "-r", "chroot_names", 
13      help="Chroot name, e.g. fedora-18-x86_64.", 
14      multiple=True 
15  ) 
16 -def drop_chroot(chroot_names):
17 """Deactivates a chroot""" 18 for chroot_name in chroot_names: 19 try: 20 coprs_logic.MockChrootsLogic.delete_by_name(chroot_name) 21 db.session.commit() 22 except exceptions.MalformedArgumentException: 23 print_invalid_format(chroot_name) 24 except exceptions.NotFoundException: 25 print_doesnt_exist(chroot_name)
26