Created
November 20, 2015 09:03
-
-
Save lubomir/c78091bf286ee9764f99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import pdc_client | |
# This will automatically obtain token from server identified by "prod" in | |
# configuration file. | |
client = pdc_client.PDCClient('prod') | |
def run(resource): | |
print 'Running tests for {}'.format(resource) | |
for component in pdc_client.get_paged(client[resource]._): | |
id = component['id'] | |
name = component['name'] | |
release = component.get('release', {}).get('release_id', '[global]') | |
seen_roles = set() | |
for contact in component['contacts']: | |
if contact['contact_role'] in seen_roles: | |
print 'Duplicated roles for {}:{}/{}'.format(id, release, name) | |
seen_roles.add(contact['contact_role']) | |
print '' | |
run('global-components') | |
run('release-components') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment