From 6b106418b032949fb505a818d99b61491a910640 Mon Sep 17 00:00:00 2001 From: luxingmin Date: Sun, 22 May 2016 00:58:08 +0800 Subject: [PATCH] create subnet without gateway According to the api ref of openstakc,When we want to specify a subnet without a gateway, set the gateway_ip attribute to null in the request body. But the function createJson in PersistentResource will remove the null attribute. This will resolve the problem --- lib/OpenCloud/Common/Resource/PersistentResource.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/OpenCloud/Common/Resource/PersistentResource.php b/lib/OpenCloud/Common/Resource/PersistentResource.php index 33aa1c398..976d06a47 100644 --- a/lib/OpenCloud/Common/Resource/PersistentResource.php +++ b/lib/OpenCloud/Common/Resource/PersistentResource.php @@ -219,6 +219,8 @@ protected function createJson() foreach ($this->createKeys as $key) { if (null !== ($property = $this->getProperty($key))) { $element->{$this->getAlias($key)} = $this->recursivelyAliasPropertyValue($property); + } elseif ($key == 'gatewayIp') { + $element->{$this->getAlias($key)} = null; } }