Trees | Indices | Help |
---|
|
1 from flask_script import Command, Option 2 from coprs import exceptions 3 from coprs import db 4 from coprs.helpers import chroot_to_branch 5 from coprs.logic import coprs_logic 6 7926 2711 print( 12 "{0} - invalid chroot format, must be '{release}-{version}-{arch}'." 13 .format(chroot_name))1416 print("{0} - already exists.".format(chroot_name))1719 print("{0} - chroot doesn\"t exist.".format(chroot_name))20 21 option_list = ( 22 Option("chroot_names", 23 help="Chroot name, e.g. fedora-18-x86_64.", 24 nargs="+"), 25 )29 30 "Creates a mock chroot in DB" 315233 self.option_list += Option( 34 "--dist-git-branch", 35 "-b", 36 dest="branch", 37 help="Branch name for this set of new chroots"),3840 for chroot_name in chroot_names: 41 if not branch: 42 branch = chroot_to_branch(chroot_name) 43 branch_object = coprs_logic.BranchesLogic.get_or_create(branch) 44 try: 45 chroot = coprs_logic.MockChrootsLogic.add(chroot_name) 46 chroot.distgit_branch = branch_object 47 db.session.commit() 48 except exceptions.MalformedArgumentException: 49 self.print_invalid_format(chroot_name) 50 except exceptions.DuplicateException: 51 self.print_already_exists(chroot_name)
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 | http://epydoc.sourceforge.net |