<commit_before>#!/usr/bin/env python
from __future__ import print_function

from utility import run_command


ceilometer_cmds = [
    ('/usr/bin/ceilometer', 'resource-list'),
]


cinder_cmds = [
    ('/usr/bin/cinder', 'list'),
    ('/usr/bin/cinder', 'list-extensions'),
    ('/usr/bin/cinder', 'snapshot-list'),
    ('/usr/bin/cinder', 'transfer-list'),
    ('/usr/bin/cinder', 'type-list'),
]


glance_cmds = [
    ('/usr/bin/glance', 'image-list'),
]


heat_cmds = [
    ('/usr/bin/heat', 'stack-list'),
]


keystone_cmds = [
    ('/usr/bin/keystone', 'ec2-credentials-list'),
    ('/usr/bin/keystone', 'endpoint-list'),
    ('/usr/bin/keystone', 'role-list'),
    ('/usr/bin/keystone', 'service-list'),
    ('/usr/bin/keystone', 'tenant-list'),
    ('/usr/bin/keystone', 'token-get'),
    ('/usr/bin/keystone', 'user-list'),
    ('/usr/bin/keystone', 'user-role-list'),
]


neutron_cmds = [
    ('/usr/bin/neutron', 'net-list'),
    ('/usr/bin/neutron', 'router-list'),
    ('/usr/bin/neutron', 'subnet-list'),
]


nova_cmds = [
    ('/usr/bin/nova', 'flavor-list'),
    ('/usr/bin/nova', 'floating-ip-list'),
    ('/usr/bin/nova', 'floating-ip-pool-list'),
    ('/usr/bin/nova', 'keypair-list'),
    ('/usr/bin/nova', 'host-list'),
    ('/usr/bin/nova', 'hypervisor-list'),
    ('/usr/bin/nova', 'image-list'),
    ('/usr/bin/nova', 'network-list'),
    ('/usr/bin/nova', 'secgroup-list'),
    ('/usr/bin/nova', 'service-list'),
]


swift_cmds = [
    ('/usr/bin/swift', 'list'),
]


def run_cmds(commands):
    for cmd in commands:
        return run_command(cmd, verbose=True)


if __name__ == '__main__':
    """Perform basic Openstack command line checks."""
    run_cmds(ceilometer_cmds)
    run_cmds(cinder_cmds)
    run_cmds(glance_cmds)
    run_cmds(heat_cmds)
    run_cmds(keystone_cmds)
    run_cmds(neutron_cmds)
    run_cmds(nova_cmds)
    run_cmds(swift_cmds)
<commit_msg>Run all the commands, not just the first one.<commit_after>#!/usr/bin/env python
from __future__ import print_function

from utility import run_command


ceilometer_cmds = [
    ('/usr/bin/ceilometer', 'resource-list'),
]


cinder_cmds = [
    ('/usr/bin/cinder', 'list'),
    ('/usr/bin/cinder', 'list-extensions'),
    ('/usr/bin/cinder', 'snapshot-list'),
    ('/usr/bin/cinder', 'transfer-list'),
    ('/usr/bin/cinder', 'type-list'),
]


glance_cmds = [
    ('/usr/bin/glance', 'image-list'),
]


heat_cmds = [
    ('/usr/bin/heat', 'stack-list'),
]


keystone_cmds = [
    ('/usr/bin/keystone', 'ec2-credentials-list'),
    ('/usr/bin/keystone', 'endpoint-list'),
    ('/usr/bin/keystone', 'role-list'),
    ('/usr/bin/keystone', 'service-list'),
    ('/usr/bin/keystone', 'tenant-list'),
    ('/usr/bin/keystone', 'token-get'),
    ('/usr/bin/keystone', 'user-list'),
    ('/usr/bin/keystone', 'user-role-list'),
]


neutron_cmds = [
    ('/usr/bin/neutron', 'net-list'),
    ('/usr/bin/neutron', 'router-list'),
    ('/usr/bin/neutron', 'subnet-list'),
]


nova_cmds = [
    ('/usr/bin/nova', 'flavor-list'),
    ('/usr/bin/nova', 'floating-ip-list'),
    ('/usr/bin/nova', 'floating-ip-pool-list'),
    ('/usr/bin/nova', 'keypair-list'),
    ('/usr/bin/nova', 'host-list'),
    ('/usr/bin/nova', 'hypervisor-list'),
    ('/usr/bin/nova', 'image-list'),
    ('/usr/bin/nova', 'network-list'),
    ('/usr/bin/nova', 'secgroup-list'),
    ('/usr/bin/nova', 'service-list'),
]


swift_cmds = [
    ('/usr/bin/swift', 'list'),
]


def run_cmds(commands):
    for cmd in commands:
        run_command(cmd, verbose=True)


if __name__ == '__main__':
    """Perform basic Openstack command line checks."""
    run_cmds(ceilometer_cmds)
    run_cmds(cinder_cmds)
    run_cmds(glance_cmds)
    run_cmds(heat_cmds)
    run_cmds(keystone_cmds)
    run_cmds(neutron_cmds)
    run_cmds(nova_cmds)
    run_cmds(swift_cmds)

{'fraction_non_alphanumeric': 0.22683118928852716, 'fraction_numerical': 0.0005250721974271463, 'mean_word_length': 3.2380422691879867, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2066037', 'n_tokens_mistral': 1609, 'n_tokens_neox': 1490, 'n_words': 215}