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