fix TypeError
diff --git a/plstackapi/openstack/driver.py b/plstackapi/openstack/driver.py
index aac72ab..41a6208 100644
--- a/plstackapi/openstack/driver.py
+++ b/plstackapi/openstack/driver.py
@@ -120,10 +120,10 @@
def create_network(self, name):
nets = self.shell.quantum.list_networks(name=name)
- if not nets:
- net = self.shell.quantum.create_network(name, admin_state_up=True)
- else:
+ if len(nets) > 0:
net = nets[0]
+ else:
+ net = self.shell.quantum.create_network(name, admin_state_up=True)
return net
def delete_network(self, name):