Trees | Indices | Help |
---|
|
1 import click 2 3 from coprs import exceptions 4 from coprs import db 5 from coprs.helpers import chroot_to_branch 6 from coprs.logic import coprs_logic10 print( 11 "{0} - invalid chroot format, must be '{release}-{version}-{arch}'." 12 .format(chroot_name))1316 print("{0} - already exists.".format(chroot_name))1720 print("{0} - chroot doesn\"t exist.".format(chroot_name))2124 """Creates a mock chroot in DB""" 25 for chroot_name in chroot_names: 26 if not branch: 27 branch = chroot_to_branch(chroot_name) 28 branch_object = coprs_logic.BranchesLogic.get_or_create(branch) 29 try: 30 chroot = coprs_logic.MockChrootsLogic.add(chroot_name) 31 chroot.distgit_branch = branch_object 32 chroot.is_active = activated 33 db.session.commit() 34 except exceptions.MalformedArgumentException: 35 print_invalid_format(chroot_name) 36 except exceptions.DuplicateException: 37 print_already_exists(chroot_name)38 39 40 @click.command() 41 @click.argument( 42 "chroot_names", 43 nargs=-1, 44 required=True 45 ) 46 @click.option( 47 "--dist-git-branch", "-b", "branch", 48 help="Branch name for this set of new chroots" 49 ) 50 @click.option( 51 "--activated/--deactivated", 52 help="Activate the chroot later, manually by `alter-chroot`", 53 default=True 54 )56 """Creates a mock chroot in DB""" 57 return create_chroot_function(chroot_names, branch, activated)58
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 | http://epydoc.sourceforge.net |