Skip to content

Instantly share code, notes, and snippets.

@lubomir
Created November 20, 2015 09:03
Show Gist options
  • Save lubomir/c78091bf286ee9764f99 to your computer and use it in GitHub Desktop.
Save lubomir/c78091bf286ee9764f99 to your computer and use it in GitHub Desktop.
#! /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