Пример #1
0
    def add_clone_arguments(self, parser, required=False):
        active_group = parser.add_mutually_exclusive_group()
        active_group.add_argument('--activate',
                                  action='store_const',
                                  const=True,
                                  dest='active')
        active_group.add_argument('--deactivate',
                                  action='store_const',
                                  const=False,
                                  dest='active')

        optional_args = {
            'short': {},
            'version': {},
            'release_type': {},
            'base_product': {},
            'name': {},
            'product_version': {},
            'bugzilla__product': {
                'arg': 'bugzilla-product'
            },
            'dist_git__branch': {
                'arg': 'dist-git-branch'
            },
            'component_dist_git_branch': {},
            'include_inactive': {},
            'include_trees': {
                'nargs': '*'
            },
            'integrated_with': {}
        }
        add_create_update_args(parser, {}, optional_args, required)

        self.run_hook('release_parser_setup', parser)
Пример #2
0
 def add_release_component_arguments(
     self,
     parser,
     required_args,
     required=False,
     is_update=False,
 ):
     group = parser.add_mutually_exclusive_group()
     group.add_argument('--activate',
                        action='store_const',
                        const=True,
                        dest='active')
     group.add_argument('--deactivate',
                        action='store_const',
                        const=False,
                        dest='active')
     optional_arguments = {
         'dist_git_branch': {},
         'bugzilla_component': {},
         'brew_package': {},
         'type': {},
         'srpm__name': {
             'arg': 'srpm-name'
         }
     }
     if is_update:
         optional_arguments.update({'global_component': {}})
     add_create_update_args(parser, required_args, optional_arguments,
                            required)
Пример #3
0
    def add_release_arguments(self, parser, required=False):
        group = parser.add_mutually_exclusive_group()
        group.add_argument('--activate',
                           action='store_const',
                           const=True,
                           dest='active')
        group.add_argument('--deactivate',
                           action='store_const',
                           const=False,
                           dest='active')

        required_args = {
            'version': {},
            'short': {},
            'release_type': {},
            'name': {}
        }
        optional_args = {
            'product_version': {},
            'base_product': {},
            'bugzilla__product': {
                'arg': 'bugzilla-product'
            },
            'dist_git__branch': {
                'arg': 'dist-git-branch'
            }
        }
        add_create_update_args(parser, required_args, optional_args, required)

        self.run_hook('release_parser_setup', parser)
Пример #4
0
 def add_global_component_arguments(self, parser, required=False):
     add_create_update_args(parser,
                            {'name': {}},
                            {'dist_git_path': {}},
                            required)
     add_parser_arguments(parser, {
         'upstream__homepage': {'arg': 'homepage'},
         'upstream__scm_type': {'arg': 'scm-type'},
         'upstream__scm_url': {'arg': 'scm-url'}},
         group='Upstream (optional)')
Пример #5
0
 def add_compose_tree_location_arguments(self, parser, required=False):
     required_args = {
         'compose': {},
         'variant': {},
         'arch': {},
         'location': {},
         'scheme': {},
         'synced_content': {'nargs': '*', 'choices': ['binary', 'debug', 'source']},
         'url': {}}
     optional_args = {}
     add_create_update_args(parser, required_args, optional_args, required)
 def add_compose_full_import_arguments(self, parser, required=False):
     required_args = {
         'release_id': {'type': str},
         'composeinfo': {},
         'rpm_manifest': {},
         'image_manifest': {},
         'location': {'type': str},
         'url': {'type': str},
         'scheme': {'type': str}}
     optional_args = {}
     add_create_update_args(parser, required_args, optional_args, required)
Пример #7
0
 def add_create_arguments(self, parser, required=True):
     add_create_update_args(parser,
                            {'component': {},
                             'role': {},
                             'contact__email': {'arg': 'email'}},
                            {},
                            required)
     add_mutually_exclusive_args(parser,
                                 {'contact__username': {'arg': 'username'},
                                  'contact__mail_name': {'arg': 'mail-name'}},
                                 required)
Пример #8
0
 def add_release_component_arguments(self, parser, required=False):
     group = parser.add_mutually_exclusive_group()
     group.add_argument('--activate', action='store_const', const=True, dest='active')
     group.add_argument('--deactivate', action='store_const', const=False, dest='active')
     add_create_update_args(parser,
                            {'name': {}},
                            {'dist_git_branch': {},
                             'bugzilla_component': {},
                             'brew_package': {},
                             'type': {},
                             'srpm__name': {'arg': 'srpm-name'}},
                            required)
Пример #9
0
    def add_clone_arguments(self, parser, required=False):
        optional_args = {
            "include_service": {"metavar": "SERVICE"},
            "include_repo_family": {"metavar": "REPO_FAMILY"},
            "include_content_format": {"metavar": "CONTENT_FORMAT"},
            "include_content_category": {"metavar": "CONTENT_CATEGORY"},
        }
        add_create_update_args(parser, {}, optional_args, required)

        shadow_group = parser.add_mutually_exclusive_group()
        shadow_group.add_argument("--include-shadow", action="store_true")
        shadow_group.add_argument("--exclude-shadow", action="store_false", dest="include_shadow")

        optional_args = {"include_product_id": {"metavar": "PRODUCT_ID", "type": int}}
        add_create_update_args(parser, {}, optional_args, required)
 def add_create_arguments(self, parser, required=True):
     add_create_update_args(
         parser,
         {
             "component__release": {"arg": "release"},
             "component__name": {"arg": "component"},
             "role": {},
             "contact__email": {"arg": "email"},
         },
         {},
         required,
     )
     add_mutually_exclusive_args(
         parser, {"contact__username": {"arg": "username"}, "contact__mail_name": {"arg": "mail-name"}}, required
     )
Пример #11
0
 def add_global_component_arguments(self, parser, required=False):
     add_create_update_args(parser, {'name': {}}, {'dist_git_path': {}},
                            required)
     add_parser_arguments(parser, {
         'upstream__homepage': {
             'arg': 'homepage'
         },
         'upstream__scm_type': {
             'arg': 'scm-type'
         },
         'upstream__scm_url': {
             'arg': 'scm-url'
         }
     },
                          group='Upstream (optional)')
Пример #12
0
    def add_repo_arguments(self, parser, required=False):
        required_args = {
            'arch': {},
            'content_category': {},
            'content_format': {},
            'name': {},
            'release_id': {},
            'repo_family': {},
            'service': {},
            'variant_uid': {}
        }
        optional_args = {'product_id': {'type': int},
                         'shadow': {'help': 'default is false when create a content delivery repo',
                                    'metavar': 'SHADOW_FLAG'}}

        add_create_update_args(parser, required_args, optional_args, required)
Пример #13
0
 def add_create_arguments(self, parser, required=True):
     add_create_update_args(parser, {
         'component': {},
         'role': {},
         'contact__email': {
             'arg': 'email'
         }
     }, {}, required)
     add_mutually_exclusive_args(
         parser, {
             'contact__username': {
                 'arg': 'username'
             },
             'contact__mail_name': {
                 'arg': 'mail-name'
             }
         }, required)
Пример #14
0
    def add_repo_arguments(self, parser, required=False):
        required_args = {
            "arch": {},
            "content_category": {},
            "content_format": {},
            "name": {},
            "release_id": {},
            "repo_family": {},
            "service": {},
            "variant_uid": {},
        }
        optional_args = {
            "product_id": {"type": int},
            "shadow": {"help": "default is false when create a content delivery repo", "metavar": "SHADOW_FLAG"},
        }

        add_create_update_args(parser, required_args, optional_args, required)
Пример #15
0
    def add_release_arguments(self, parser, required=False):
        group = parser.add_mutually_exclusive_group()
        group.add_argument('--activate', action='store_const', const=True, dest='active')
        group.add_argument('--deactivate', action='store_const', const=False, dest='active')

        required_args = {
            'version': {},
            'short': {},
            'release_type': {},
            'name': {}}
        optional_args = {
            'product_version': {},
            'base_product': {},
            'bugzilla__product': {'arg': 'bugzilla-product'},
            'dist_git__branch': {'arg': 'dist-git-branch'}}
        add_create_update_args(parser, required_args, optional_args, required)

        self.run_hook('release_parser_setup', parser)
Пример #16
0
    def add_clone_arguments(self, parser):
        necessary_args = {
            'release_id_from': {
                'metavar': 'RELEASE_ID_FROM'
            },
            'release_id_to': {
                'metavar': 'RELEASE_ID_TO'
            },
        }
        optional_args = {
            'include_service': {
                'nargs': '*',
                'metavar': 'SERVICE'
            },
            'include_repo_family': {
                'nargs': '*',
                'metavar': 'REPO_FAMILY'
            },
            'include_content_format': {
                'nargs': '*',
                'metavar': 'CONTENT_FORMAT'
            },
            'include_content_category': {
                'nargs': '*',
                'metavar': 'CONTENT_CATEGORY'
            },
        }
        add_create_update_args(parser, necessary_args, optional_args, True)

        shadow_group = parser.add_mutually_exclusive_group()
        shadow_group.add_argument('--include-shadow', action='store_true')
        shadow_group.add_argument('--exclude-shadow',
                                  action='store_false',
                                  dest='include_shadow')

        optional_args = {
            'include_product_id': {
                'metavar': 'PRODUCT_ID',
                'type': int
            },
        }
        add_create_update_args(parser, {}, optional_args, False)

        self.run_hook('repo_parser_setup', parser)
Пример #17
0
 def add_compose_full_import_arguments(self, parser, required=False):
     required_args = {
         'release_id': {
             'type': str
         },
         'composeinfo': {},
         'rpm_manifest': {},
         'image_manifest': {},
         'location': {
             'type': str
         },
         'url': {
             'type': str
         },
         'scheme': {
             'type': str
         }
     }
     optional_args = {}
     add_create_update_args(parser, required_args, optional_args, required)
Пример #18
0
    def add_clone_arguments(self, parser, required=False):
        active_group = parser.add_mutually_exclusive_group()
        active_group.add_argument('--activate', action='store_const', const=True, dest='active')
        active_group.add_argument('--deactivate', action='store_const', const=False, dest='active')

        optional_args = {
            'short': {},
            'version': {},
            'release_type': {},
            'base_product': {},
            'name': {},
            'product_version': {},
            'bugzilla__product': {'arg': 'bugzilla-product'},
            'dist_git__branch': {'arg': 'dist-git-branch'},
            'component_dist_git_branch': {},
            'include_inactive': {},
            'include_trees': {},
            'integrated_with': {}
        }
        add_create_update_args(parser, {}, optional_args, required)

        self.run_hook('release_parser_setup', parser)
Пример #19
0
    def add_rpm_arguments(self, parser, required=False):
        required_args = {
            'arch': {},
            'epoch': {'type': int},
            'name': {},
            'release': {},
            'srpm_name': {},
            'version': {}}
        optional_args = {
            'filename': {},
            'srpm_nevra': {},
            'linked_releases': {'nargs': '*', 'metavar': 'RELEASE_ID'}}
        add_create_update_args(parser, required_args, optional_args, required)

        add_parser_arguments(parser, {
            'dependencies__requires': {'nargs': '*', 'metavar': 'DEPENDENCY', 'arg': 'requires'},
            'dependencies__provides': {'nargs': '*', 'metavar': 'DEPENDENCY', 'arg': 'provides'},
            'dependencies__suggests': {'nargs': '*', 'metavar': 'DEPENDENCY', 'arg': 'suggests'},
            'dependencies__obsoletes': {'nargs': '*', 'metavar': 'DEPENDENCY', 'arg': 'obsoletes'},
            'dependencies__recommends': {'nargs': '*', 'metavar': 'DEPENDENCY', 'arg': 'recommends'},
            'dependencies__conflicts': {'nargs': '*', 'metavar': 'DEPENDENCY', 'arg': 'conflicts'}},
            group='Dependencies (optional)')
Пример #20
0
    def add_repo_arguments(self, parser, required=False):
        required_args = {
            'arch': {},
            'content_category': {},
            'content_format': {},
            'name': {},
            'release_id': {},
            'repo_family': {},
            'service': {},
            'variant_uid': {}
        }
        optional_args = {
            'product_id': {
                'type': int
            },
            'shadow': {
                'help': 'default is false when create a content delivery repo',
                'metavar': 'SHADOW_FLAG'
            }
        }

        add_create_update_args(parser, required_args, optional_args, required)
Пример #21
0
    def add_rpm_arguments(self, parser, required=False):
        required_args = {
            'arch': {},
            'epoch': {'type': int},
            'name': {},
            'release': {},
            'srpm_name': {},
            'version': {}}
        optional_args = {
            'filename': {},
            'srpm_nevra': {},
            'linked_releases': {'nargs': '*', 'metavar': 'RELEASE_ID'}}
        add_create_update_args(parser, required_args, optional_args, required)

        add_parser_arguments(parser, {
            'dependencies__requires': {'nargs': '*', 'metavar': 'DEPENDENCY', 'arg': 'requires'},
            'dependencies__provides': {'nargs': '*', 'metavar': 'DEPENDENCY', 'arg': 'provides'},
            'dependencies__suggests': {'nargs': '*', 'metavar': 'DEPENDENCY', 'arg': 'suggests'},
            'dependencies__obsoletes': {'nargs': '*', 'metavar': 'DEPENDENCY', 'arg': 'obsoletes'},
            'dependencies__recommends': {'nargs': '*', 'metavar': 'DEPENDENCY', 'arg': 'recommends'},
            'dependencies__conflicts': {'nargs': '*', 'metavar': 'DEPENDENCY', 'arg': 'conflicts'}},
            group='Dependencies (optional)')
Пример #22
0
 def add_update_argument(self, parser, required=True):
     optional_args = {'resource': {}, 'permission': {}, 'group': {}}
     add_create_update_args(parser, {}, optional_args, required)