ruby-openstack/ruby-openstack — pull request #13 by marios (2012-09-10 13:32:08+00:00)
Title: Check whether requested service is deployed and return 501 Not Implemented otherwise

This issue came up in testing with Deltacloud - see [the jira ticket](see https://issues.apache.org/jira/browse/DTACLOUD-316) for the original bug report.

Basically, if the given Openstack service hasn't deployed e.g. object-store (swift) then the client is still able to get a handle for the service, with things blowing up later.

This fix checks the returned serviceCatalog and if the requested service isn't available will raise a

OpenStack::Exception::NotImplemented:The requested service: "object-store" is not present in the returned service catalogue.