API Phyton on OSX broken?

Hi, We have been using Phyton scripts on OSX without any issues for some time now. But suddenly (do not know if it happened after the latest OSX security fixes) the stopped working. Example, we use this script to list and get the servers and their IPs:

from operator import attrgetter

import profitbricks_client

def main():
    client = profitbricks_client.get_profitbricks_client(api_version='1.3')
    datacenter_ids = [dc.dataCenterId for dc in client.getAllDataCenters()]
    for datacenter_id in datacenter_ids:
        datacenter = client.getDataCenter(dataCenterId=datacenter_id)
        print datacenter.dataCenterName + ':'
        servers = sorted(datacenter.servers, key=attrgetter('serverName'))
        for server in [s for s in servers if hasattr(s, 'ips')]:
            print server.serverName + '   ' + ' '.join(server.ips)

if __name__ == '__main__':

and when we run it now we get a whole bunch of errors like:

profit Traceback (most recent call last): main()
profit  client = profitbricks_client.get_profitbricks_client(api_version='1.3')  endpoint = get_endpoint(api_version, endpoint, config, store_endpoint)  _retreive_support_matrix_file())  older, newer, supported = _parse_support_matrix(support_matrix_file, client_version) profitbricks_client.SupportMatrixMalformedException: Failed to parse This file is malformed. Please contact support. You can work around this issue by specifying an endpoint with --endpoint.

Any ideas what happened? Thanks! Nathan

  • **bold**
  • _italics_
  • `code`
  • ```code block```
  • # Heading 1
  • ## Heading 2
  • > Quote

Hello - I am wondering if you are using an older Python Client Library that talks to the SOAP API rather than REST.

The following code should gather the IP information that you are seeking using the current Python client library. ( )

import os
from profitbricks.client import ProfitBricksService

username = os.getenv('PROFITBRICKS_USERNAME')
password = os.getenv('PROFITBRICKS_PASSWORD')

client = ProfitBricksService(username=username, password=password)

datacenters = client.list_datacenters()
print 'Number of Datacenters: {0}'.format(len(datacenters))

for dc in datacenters['items']:
    print 'Datacenter: {0}'.format(dc['properties']['name'])
    servers = client.list_servers(datacenter_id=dc['id'])
    for server in servers['items']:
        print '  Server: {0}'.format(server['properties']['name'])
        nics = client.list_nics(datacenter_id=dc['id'], server_id=server['id'])
        for nic in nics['items']:
            if len(nic['properties']['ips']):
                for ips in nic['properties']['ips']:
                    if nic['properties']['name']:
                        print '    {0}: {1}'.format(
                            nic['properties']['name'], ips)
                        print '    NIC: {0}'.format(ips)
                print '    No IP currently assigned.'