Пример #1
0
 def _create_network(self, fmt, name=None, custom_req_body=None, expected_res_status=202):
     LOG.debug("Creating network")
     content_type = "application/" + fmt
     if name:
         net_name = name
     else:
         net_name = self.network_name
     network_req = testlib.new_network_request(self.tenant_id, net_name, fmt, custom_req_body)
     network_res = network_req.get_response(self.api)
     self.assertEqual(network_res.status_int, expected_res_status)
     if expected_res_status in (200, 202):
         network_data = self._deserialize_net_response(content_type, network_res)
         return network_data["network"]["id"]