def check_opensuse_incidents(self):
        requests = dict()  # collecting unique requests
        self.wait_for_build = set()
        for prj in self.tgt_repo[self.openqa.baseurl].keys():
            for r in self.ids_project(prj, 'maintenance_release'):
                requests[r.reqid] = r

        # to be stored in settings
        issues = dict()
        for req in sorted(requests.keys()):
            req = requests[req]
            types = set([a.type for a in req.actions])
            if 'maintenance_release' not in types:
                continue

            src_prjs = set([a.src_project for a in req.actions])
            if len(src_prjs) != 1:
                raise Exception("can't handle maintenance_release from different incidents")
            build = src_prjs.pop()
            incident_id = build.split(':')[-1]
            tgt_prjs = set()
            for a in req.actions:
                prj = a.tgt_project
                # ignore e.g. Backports
                if prj not in self.project_settings:
                    continue

                issues.setdefault(prj, set()).add(incident_id)
                tgt_prjs.add(prj)

            self.test_job({'project': build, 'id': incident_id, 'channels': list(tgt_prjs)})

        for prj in self.tgt_repo[self.openqa.baseurl].keys():
            s = self.tgt_repo[self.openqa.baseurl][prj]['settings']
            s['OS_TEST_ISSUES'] = ','.join(sorted(issues.get(prj, set())))
Example #2
0
def there_is_requests_requested_to_the_mock(step, number_requests):
    check_world_attribute_is_not_none(['mock_data'])
    requests = json.loads(world.mock_data.text)['requests']
    number_mock_requests = 0
    for url in requests.keys():
        number_mock_requests += len(requests[url])
    assert str(number_requests) == str(
        number_mock_requests), 'The requests to the mock were {number_mock_requests} and the expeted are {number_expected}'.format(
        number_mock_requests=number_mock_requests, number_expected=number_requests)
Example #3
0
    def get_now_playing(self):
        data = { }

        player = self.ctrl.player
        requests = player.get_requests()

        request = None
        for key in requests.keys():
            if not request or requests[key]['priority'] > request['priority']:
                request = requests[key]

        if not request:
            data['status'] = 'override'
            data['artist'] = ''
            data['title'] = ''
            data['duration'] = 0
            data['position'] = 0
            data['track'] = -1
            return data

        if request['controller'] != self.ctrl:
            data['status'] = 'override'
        elif self.ctrl.request_is_playing():
            data['status'] = 'playing'
        else:
            data['status'] = 'stopped'


        data['artist'] = request['artist']
        data['title'] = request['title']
        data['duration'] = request['duration']
        data['position'] = time.time() - request['start_time']
        data['absolute_id'] = request['absolute_id']

        if self.present_show != None and self.present_show.now_playing != None:
            now_playing = self.present_show.now_playing
            if 'group_id' in now_playing:
                data['mode'] = 'group'
                (data['group_num'], data['group_item_num']) = self.find_group_item_pos(now_playing['id'])
            else:
                data['mode'] = 'playlist'
                data['track'] = self.present_show.playlist.current_pos()

        #sebastian consultar mas datos del media
	
        #print(data)
        #print('el show actual es: ' + str(self.present_show.name()))
        #print(self.present_show)
	
        return data
Example #4
0
    def check_opensuse_incidents(self):
        requests = dict()  # collecting unique requests
        self.wait_for_build = set()
        for prj in self.tgt_repo[self.openqa.baseurl].keys():
            for r in self.ids_project(prj, 'maintenance_release'):
                requests[r.reqid] = r

        # to be stored in settings
        issues = dict()
        for req in sorted(requests.keys()):
            req = requests[req]
            types = set([a.type for a in req.actions])
            if 'maintenance_release' not in types:
                continue

            src_prjs = set([a.src_project for a in req.actions])
            if len(src_prjs) != 1:
                raise Exception(
                    "can't handle maintenance_release from different incidents"
                )
            build = src_prjs.pop()
            incident_id = build.split(':')[-1]
            tgt_prjs = set()
            for a in req.actions:
                prj = a.tgt_project
                # ignore e.g. Backports
                if prj not in self.project_settings:
                    continue

                issues.setdefault(prj, set()).add(incident_id)
                tgt_prjs.add(prj)

            self.test_job({
                'project': build,
                'id': incident_id,
                'channels': list(tgt_prjs)
            })

        for prj in self.tgt_repo[self.openqa.baseurl].keys():
            s = self.tgt_repo[self.openqa.baseurl][prj]['settings']
            s['OS_TEST_ISSUES'] = ','.join(sorted(issues.get(prj, set())))
Example #5
0
def _make_requests(parity_hosts, blocks, request):
    """
    Create json requests to parity JSON RPC API for specified blocks

    Parameters
    ----------
    parity_hosts : list
        List of tuples with each parity JSON RPC url and used block range
    blocks : list
        Block numbers
    Returns
    -------
    dict
        Urls and lists of requests attached to it
    """
    requests = {}
    for block_number in blocks:
        parity_url = _get_parity_url_by_block(parity_hosts, block_number)
        if parity_url not in requests.keys():
            requests[parity_url] = []
        requests[parity_url].append(request(block_number))
    return requests