'Returns ``None`` if it can\'t connect to the metadata server.'

@capture_logging(None)
def test_connection_error(self, logger):

    result = metadata_from_service(metadata_service_endpoint=find_free_port())
    self.assertIs(None, result)
    [message] = logger.messages
    assertContainsFields(self, message, {'message_type': 'flocker:node:agents:blockdevice:openstack:compute_instance_id:metadataservice_connection_error'})
