summaryrefslogtreecommitdiffstats
path: root/snaps
diff options
context:
space:
mode:
authorLinda Wang <wangwulin@huawei.com>2018-04-21 02:31:09 +0000
committerLinda Wang <wangwulin@huawei.com>2018-04-21 02:31:09 +0000
commit6cd8600b863ba2e5c9a230290302435a9951ce07 (patch)
tree71009b1b4f5a0e211ecffc4a16f6c032095116cd /snaps
parentf65dbaef830fe7121173fdb83e5e4dde09b11a8a (diff)
Fix NoneType error when creating router
Change-Id: Icef5f8a769b5c33da68b7da33ac8ba87132830e2 Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'snaps')
-rw-r--r--snaps/openstack/create_router.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/snaps/openstack/create_router.py b/snaps/openstack/create_router.py
index 260fc03..441b21a 100644
--- a/snaps/openstack/create_router.py
+++ b/snaps/openstack/create_router.py
@@ -14,6 +14,8 @@
# limitations under the License.
import logging
+import six
+
from neutronclient.common.exceptions import NotFound, Unauthorized
from snaps.config.router import RouterConfig
@@ -149,7 +151,7 @@ class OpenStackRouter(OpenStackNetworkObject):
:param sub_config:
:return:
"""
- if isinstance(sub_config, str):
+ if isinstance(sub_config, six.text_type):
return neutron_utils.get_subnet_by_name(
self._neutron, self._keystone,
subnet_name=sub_config)