Beispiel #1
0

def applyProp(d, query, prop, arg, sep):
    p = safeGet(arg, d)
    if p is not None:
        tmp = sep.join(p)

    query += " {}:{} ".format(prop, tmp)
    return query


def applyOrProp(d, query, prop, arg):
    return applyProp(d, query, prop, arg, " OR ")


client = GerritSSHClient("gerrit.ovirt.org")


def run_gerrit_command(command):
    try:
        return client.run_gerrit_command(command)
    except Exception as e:
        print 'Error when running gerrit command:', e


def get_topic_changes(d):
    query = "query --format=JSON status:open --current-patch-set"
    query = applyOrProp(d, query, "owner", "owners")
    query = applyOrProp(d, query, "topic", "topics")
    query = applyOrProp(d, query, "project", "projects")
    log.info("Running query %s", query)
Beispiel #2
0
    help='Show day with maximum number of patch sets overall projects')
parser.add_argument('--per-project',
                    action="store_true",
                    dest='per_project',
                    default=False,
                    help='Show statistics per each project')

args = parser.parse_args()

start = [int(i) for i in args.start.split('-')]
end = [int(i) for i in args.end.split('-')]

d_start = date(start[0], start[1], start[2])
d_end = date(end[0], end[1], end[2])

client = GerritSSHClient("review")

openstack_projects = [
    'nova', 'cinder', 'glance', 'keystone', 'horizon', 'neutron', 'designate',
    'heat', 'ironic', 'barbican', 'aodh', 'ceilometer', 'gnocchi', 'panko',
    'manila', 'salt', 'linux', 'reclass', 'galera', 'memcached', 'rabbitmq',
    'bind', 'apache', 'runtest', 'oslo-templates', 'auditd', 'octavia',
    'openscap'
]
openstack_salt_formulas = [
    'salt-formulas/{}'.format(i) for i in openstack_projects
]
pkg_projects = ['^packaging/specs/.*']
aio_model = ['salt-models/mcp-virtual-aio']
model_projects = ['mk/cookiecutter-templates', 'salt-models/reclass-system']
projects = openstack_salt_formulas + pkg_projects + model_projects + aio_model