Esempio n. 1
0
    def callback(results):
        reactor.stop()

        for success, result in results:
            if success:
                from pprint import pprint
                pprint(result)
            else:
                print result.printTraceback()

    deferreds = []
    if len(sys.argv) < 2:
        deferreds.extend((
            client.listConfigurations(name='default.page.size'),
            client.listZones(),
            client.listPods(),
            client.listClusters(),
            client.listHosts(),
            client.listSystemVms(),
            client.listRouters(),
            client.listVirtualMachines(),
            client.listCapacity(),
            client.listAlerts(),
            client.listEvents(),
        ))
    else:
        for command in sys.argv[1:]:
            call = getattr(client, command, None)
            if call is not None:
                if command == 'listConfigurations':
        reactor.stop()

        for success, result in results:
            if success:
                from pprint import pprint
                pprint(result)
            elif hasattr(result, 'value') and hasattr(result.value, 'response'):
                print result.value.response
            else:
                print result.getErrorMessage()

    deferreds = []
    if len(sys.argv) < 2:
        deferreds.extend((
            client.listConfigurations(name='default.page.size'),
            client.listZones(available='true'),
            client.listPods(),
            client.listClusters(),
            client.listHosts(),
            client.listSystemVms(),
            client.listRouters(listAll='true'),
            client.listVirtualMachines(),
            client.listCapacity(),
            client.listAlerts(),
            client.listEvents(),
            ))
    else:
        for command in sys.argv[1:]:
            call = getattr(client, command, None)
            if call is not None:
                if command == 'listConfigurations':
    def callback(results):
        reactor.stop()

        for success, result in results:
            if success:
                from pprint import pprint
                pprint(result)
            else:
                print result.printTraceback()

    deferreds = []
    if len(sys.argv) < 2:
        deferreds.extend((
            client.listConfigurations(name='default.page.size'),
            client.listZones(),
            client.listPods(),
            client.listClusters(),
            client.listHosts(),
            client.listSystemVms(),
            client.listRouters(),
            client.listVirtualMachines(),
            client.listCapacity(),
            client.listAlerts(),
            client.listEvents(),
            ))
    else:
        for command in sys.argv[1:]:
            call = getattr(client, command, None)
            if call is not None:
                if command == 'listConfigurations':
Esempio n. 4
0
        for success, result in results:
            if success:
                from pprint import pprint
                pprint(result)
            elif hasattr(result, 'value') and hasattr(result.value,
                                                      'response'):
                print result.value.response
            else:
                print result.getErrorMessage()

    deferreds = []
    if len(sys.argv) < 2:
        deferreds.extend((
            client.listConfigurations(name='default.page.size'),
            client.listZones(available='true'),
            client.listPods(),
            client.listClusters(),
            client.listHosts(),
            client.listSystemVms(),
            client.listRouters(listAll='true'),
            client.listVirtualMachines(),
            client.listCapacity(),
            client.listAlerts(),
            client.listEvents(),
        ))
    else:
        for command in sys.argv[1:]:
            call = getattr(client, command, None)
            if call is not None:
                if command == 'listConfigurations':