def get_fields_from_job_name(self, job_name):
        """Analyze a Jenkins job name, producing a dictionary

        The produced dictionary will include information about the category
        and subcategory of the job name, and any extra information which
        could be useful.

        For each deployment of a Jenkins dashboard, an implementation of
        this function should be produced, according to the needs of the users.

        :param job: job name to Analyze
        :returns:   dictionary with categorization information

        """

        extra_fields = {
            'category': None,
            'installer': None,
            'scenario': None,
            'testproject': None,
            'pod': None,
            'loop': None,
            'branch': None
        }

        try:
            components = job_name.split('-')

            if len(components) < 2:
                return extra_fields

            kind = components[1]
            if kind == 'os':
                extra_fields['category'] = 'parent/main'
                extra_fields['installer'] = components[0]
                extra_fields['scenario'] = '-'.join(components[2:-3])
            elif kind == 'deploy':
                extra_fields['category'] = 'deploy'
                extra_fields['installer'] = components[0]
            else:
                extra_fields['category'] = 'test'
                extra_fields['testproject'] = components[0]
                extra_fields['installer'] = components[1]

            extra_fields['pod'] = components[-3]
            extra_fields['loop'] = components[-2]
            extra_fields['branch'] = components[-1]
        except IndexError as ex:
            # Just DEBUG level because it is just for OPNFV
            logger.debug('Problems parsing job name %s', job_name)
            logger.debug(ex)

        return extra_fields
def get_fields_from_job_name ( self , job_name ) : extra_fields = { 'category' : None , 'installer' : None , 'scenario' : None , 'testproject' : None , 'pod' : None , 'loop' : None , 'branch' : None } try : components = job_name . split ( '-' ) if len ( components ) < 2 : return extra_fields kind = components [ 1 ] if kind == 'os' : extra_fields [ 'category' ] = 'parent/main' extra_fields [ 'installer' ] = components [ 0 ] extra_fields [ 'scenario' ] = '-' . join ( components [ 2 : - 3 ] ) elif kind == 'deploy' : extra_fields [ 'category' ] = 'deploy' extra_fields [ 'installer' ] = components [ 0 ] else : extra_fields [ 'category' ] = 'test' extra_fields [ 'testproject' ] = components [ 0 ] extra_fields [ 'installer' ] = components [ 1 ] extra_fields [ 'pod' ] = components [ - 3 ] extra_fields [ 'loop' ] = components [ - 2 ] extra_fields [ 'branch' ] = components [ - 1 ] except IndexError as ex : logger . debug ( 'Problems parsing job name %s' , job_name ) logger . debug ( ex ) return extra_fields
Analyze a Jenkins job name, producing a dictionary

        The produced dictionary will include information about the category
        and subcategory of the job name, and any extra information which
        could be useful.

        For each deployment of a Jenkins dashboard, an implementation of
        this function should be produced, according to the needs of the users.

        :param job: job name to Analyze
        :returns:   dictionary with categorization information