Ejemplo n.º 1
0
    def register(self):
        self.set_command('compose-image-rtt-tests')
        list_parser = self.add_action('list',
                                      help='list all compose image rtt tests')
        add_parser_arguments(list_parser, {
            'compose': {},
            'variant': {},
            'arch': {},
            'file_name': {},
            'test_result': {}
        },
                             group='Filtering')
        list_parser.set_defaults(func=self.list_compose_image_rtt_tests)

        info_parser = self.add_action(
            'info', help='display details of a compose image RTT test')
        self._add_common_arguments(info_parser)
        info_parser.set_defaults(func=self.compose_image_rtt_test_info)

        help_text = 'update an existing compose image\'s RTT test result (untested, passed or failed)'
        update_parser = self.add_action('update', help=help_text)
        self._add_common_arguments(update_parser)
        add_parser_arguments(
            update_parser,
            {'test_result': {
                'choices': ['passed', 'failed', 'untested']
            }})
        update_parser.set_defaults(func=self.compose_image_rtt_test_update)
Ejemplo n.º 2
0
    def register(self):
        self.set_command('group-resource-permissions')
        list_parser = self.add_action('list', help='list all groups and their resource permissions')
        add_parser_arguments(list_parser, {'resource': {},
                                           'permission': {},
                                           'group': {}},
                             group='Filtering')
        list_parser.set_defaults(func=self.list_group_resource_permission)

        info_parser = self.add_action('info', help='display details about a group resource permission')
        info_parser.add_argument('id', metavar='ID')
        info_parser.set_defaults(func=self.group_resource_permission_info)

        update_parser = self.add_action('update', help='update an existing group resource permission')
        update_parser.add_argument('id', metavar='ID')
        self.add_update_argument(update_parser, required=True)
        update_parser.set_defaults(func=self.group_resource_permission_update)

        create_parser = self.add_action('create', help='grant a resource permission to a group')
        self.add_create_argument(create_parser, required=True)
        create_parser.set_defaults(func=self.group_resource_permission_create)

        delete_parser = self.add_action('delete', help='revoke a resource permission from a group')
        delete_parser.add_argument('id', metavar='ID')
        delete_parser.set_defaults(func=self.group_resource_permission_delete)
Ejemplo n.º 3
0
    def register(self):
        self.set_command('build-image-rtt-tests')
        list_parser = self.add_action('list',
                                      help='list all build image rtt tests')
        add_parser_arguments(list_parser, {
            'build_nvr': {},
            'image_format': {},
            'test_result': {}
        },
                             group='Filtering')
        list_parser.set_defaults(func=self.list_build_image_rrt_tests)

        info_parser = self.add_action('info',
                                      help='display details of \
                                                   a build image rtt tests')
        info_parser.add_argument('build_nvr', metavar='BUILD_NVR')
        info_parser.add_argument('image_format', metavar='IMAGE_FORMAT')
        info_parser.set_defaults(func=self.build_image_rrt_tests_info)

        update_parser = self.add_action('update',
                                        help='Partial update an exist \
                                                       build image rtt tests by test_result \
                                                       which value choices from \
                                                       [passed, failed, untested]'
                                        )
        update_parser.add_argument('build_nvr', metavar='BUILD_NVR')
        update_parser.add_argument('image_format', metavar='IMAGE_FORMAT')
        add_parser_arguments(
            update_parser,
            {'test_result': {
                'choices': ['passed', 'failed', 'untested']
            }})
        update_parser.set_defaults(func=self.build_image_rrt_tests_update)
Ejemplo n.º 4
0
    def register(self):
        self.set_command('build-image')

        list_parser = self.add_action('list', help='list all build images')
        list_parser.add_argument('--show-md5',
                                 action='store_true',
                                 help='whether to display md5 checksums')
        add_parser_arguments(list_parser, {
            'component_name': {},
            'rpm_version': {},
            'rpm_release': {},
            'image_id': {},
            'image_format': {},
            'md5': {},
            'archive_build_nvr': {},
            'archive_name': {},
            'archive_size': {},
            'archive_md5': {},
            'release_id': {}
        },
                             group='Filtering')
        list_parser.set_defaults(func=self.list_build_image)

        info_parser = self.add_action('info',
                                      help='display details of a build image')
        info_parser.add_argument('image_id', metavar='IMAGE_ID')
        info_parser.set_defaults(func=self.build_image_info)
Ejemplo n.º 5
0
    def register(self):
        self.set_command('compose-tree-locations')

        list_parser = self.add_action('list', help='list all compose-variant-arch \
                                                    relevant to location')
        add_parser_arguments(list_parser, {'compose': {},
                                           'variant': {},
                                           'arch': {},
                                           'location': {},
                                           'scheme': {}},
                             group='Filtering')
        list_parser.set_defaults(func=self.compose_tree_location_list)

        info_parser = self.add_action('info', help='display details of a compose-variant-arch \
                                                    relevant to a location')
        self._add_common_arguments(info_parser)
        info_parser.set_defaults(func=self.compose_tree_location_info)

        help_text = 'update an existing compose-tree-locations\'s fields scheme, synced-content and url'
        update_parser = self.add_action('update', help=help_text)
        self._add_common_arguments(update_parser)
        add_parser_arguments(update_parser, {'scheme': {},
                                             'url': {},
                                             'synced_content': {'nargs': '*', 'choices': ['binary', 'debug',
                                                                                          'source']}})
        update_parser.set_defaults(func=self.compose_tree_location_update)

        create_parser = self.add_action('create', help='create a new compose-variant-arch relevant to a location')
        self.add_compose_tree_location_arguments(create_parser, required=True)
        create_parser.set_defaults(func=self.compose_tree_location_create)

        delete_parser = self.add_action('delete', help='delete a compose-variant-arch relevant to a location')
        self._add_common_arguments(delete_parser)
        delete_parser.set_defaults(func=self.compose_tree_location_delete)
Ejemplo n.º 6
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)')
Ejemplo n.º 7
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)')
Ejemplo n.º 8
0
 def add_compose_arguments(self, parser):
     add_parser_arguments(
         parser, {
             'acceptance_testing': {
                 'choices': ['passed', 'failed', 'untested']
             },
             'linked_releases': {
                 'nargs': '*',
                 'metavar': 'RELEASE_ID'
             },
             'rtt_tested_architectures': {
                 'nargs': '*',
                 'default': [],
                 'help': 'input format VARIANT:ARCHES:TESTING_STATUS'
             }
         })
Ejemplo n.º 9
0
    def register(self):
        self.set_command('compose-image-rtt-tests')
        list_parser = self.add_action('list', help='list all compose image rtt tests')
        add_parser_arguments(list_parser, {'compose': {},
                                           'variant': {},
                                           'arch': {},
                                           'file_name': {},
                                           'test_result': {}},
                             group='Filtering')
        list_parser.set_defaults(func=self.list_compose_image_rtt_tests)

        info_parser = self.add_action('info', help='display details of a compose image RTT test')
        self._add_common_arguments(info_parser)
        info_parser.set_defaults(func=self.compose_image_rtt_test_info)

        help_text = 'update an existing compose image\'s RTT test result (untested, passed or failed)'
        update_parser = self.add_action('update', help=help_text)
        self._add_common_arguments(update_parser)
        add_parser_arguments(update_parser, {'test_result': {'choices': ['passed', 'failed', 'untested']}})
        update_parser.set_defaults(func=self.compose_image_rtt_test_update)
Ejemplo n.º 10
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)')
Ejemplo n.º 11
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)')
Ejemplo n.º 12
0
    def register(self):
        self.set_command('build-image')

        list_parser = self.add_action('list', help='list all build images')
        list_parser.add_argument('--show-md5', action='store_true',
                                 help='whether to display md5 checksums')
        add_parser_arguments(list_parser, {'component_name': {},
                                           'rpm_version': {},
                                           'rpm_release': {},
                                           'image_id': {},
                                           'image_format': {},
                                           'md5': {},
                                           'archive_build_nvr': {},
                                           'archive_name': {},
                                           'archive_size': {},
                                           'archive_md5': {},
                                           'release_id': {}},
                             group='Filtering')
        list_parser.set_defaults(func=self.list_build_image)

        info_parser = self.add_action('info', help='display details of a build image')
        info_parser.add_argument('image_id', metavar='IMAGE_ID')
        info_parser.set_defaults(func=self.build_image_info)
Ejemplo n.º 13
0
    def register(self):
        self.set_command('image')

        list_parser = self.add_action('list', help='list all images')
        list_parser.add_argument('--show-sha256', action='store_true',
                                 help='whether to display SHA256 checksums along with the file names')
        add_parser_arguments(list_parser, {'arch': {},
                                           'compose': {},
                                           'file_name': {},
                                           'image_format': {},
                                           'image_type': {},
                                           'implant_md5': {},
                                           'md5': {},
                                           'sha1': {},
                                           'sha256': {},
                                           'volume_id': {}},
                             group='Filtering')
        list_parser.set_defaults(func=self.image_list)

        info_parser = self.add_action('info', help='display details of an image', description=info_desc)
        info_parser.add_argument('filename', metavar='FILENAME')
        info_parser.add_argument('--sha256', nargs='?')
        info_parser.set_defaults(func=self.image_info)
Ejemplo n.º 14
0
    def register(self):
        self.set_command('build-image-rtt-tests')
        list_parser = self.add_action('list', help='list all build image rtt tests')
        add_parser_arguments(list_parser, {'build_nvr': {},
                                           'image_format': {},
                                           'test_result': {}},
                             group='Filtering')
        list_parser.set_defaults(func=self.list_build_image_rrt_tests)

        info_parser = self.add_action('info', help='display details of \
                                                   a build image rtt tests')
        info_parser.add_argument('build_nvr', metavar='BUILD_NVR')
        info_parser.add_argument('image_format', metavar='IMAGE_FORMAT')
        info_parser.set_defaults(func=self.build_image_rrt_tests_info)

        update_parser = self.add_action('update', help='Partial update an exist \
                                                       build image rtt tests by test_result \
                                                       which value choices from \
                                                       [passed, failed, untested]')
        update_parser.add_argument('build_nvr', metavar='BUILD_NVR')
        update_parser.add_argument('image_format', metavar='IMAGE_FORMAT')
        add_parser_arguments(update_parser, {'test_result': {'choices': ['passed', 'failed', 'untested']}})
        update_parser.set_defaults(func=self.build_image_rrt_tests_update)
Ejemplo n.º 15
0
 def add_compose_arguments(self, parser):
     add_parser_arguments(parser, {
         'acceptance_testing': {'choices': ['passed', 'failed', 'untested']},
         'linked_releases': {'nargs': '*', 'metavar': 'RELEASE_ID'},
         'rtt_tested_architectures': {'nargs': '*', 'default': [],
                                      'help': 'input format VARIANT:ARCHES:TESTING_STATUS'}})