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

Source Code for Module commands.comment_chroot

 1  from flask_script import Command, Option 
 2  from coprs import db 
 3  from coprs.logic.coprs_logic import MockChrootsLogic 
 4   
 5   
6 -class CommentChrootCommand(Command):
7 8 """ 9 Add comment to a mock_chroot. 10 """ 11
12 - def run(self, chrootname, comment):
13 chroot = MockChrootsLogic.get_from_name(chrootname).first() 14 if not chroot: 15 print("There is no mock chroot named {0}.".format(chrootname)) 16 return 17 chroot.comment = comment 18 db.session.commit()
19 20 option_list = ( 21 Option("chrootname"), 22 Option("comment"), 23 )
24