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

Source Code for Module commands.comment_chroot

 1  import click 
 2  from coprs import db 
 3  from coprs.logic.coprs_logic import MockChrootsLogic 
 4   
 5   
 6  @click.command() 
 7  @click.option( 
 8      "--chroot", "-r", "chrootname", 
 9      required=True 
10  ) 
11  @click.option( 
12      "--comment", "-c", "comment", 
13      required=True 
14  ) 
15 -def comment_chroot(chrootname, comment):
16 """ 17 Add comment to a mock_chroot. 18 """ 19 chroot = MockChrootsLogic.get_from_name(chrootname).first() 20 if not chroot: 21 print("There is no mock chroot named {0}.".format(chrootname)) 22 return 23 chroot.comment = comment 24 db.session.commit()
25