diff options
author | Ricardo Carrillo Cruz <emaildericky@gmail.com> | 2011-03-09 18:57:53 +0100 |
---|---|---|
committer | Ricardo Carrillo Cruz <emaildericky@gmail.com> | 2011-03-09 18:57:53 +0100 |
commit | e17876ec002f976572b6ac102dc113024669a45c (patch) | |
tree | b620a4aba925d8e0f97bb8c533eab3e67800da5e | |
parent | e81294b94e3bc8708bd4777b685a7d302594557e (diff) | |
download | nova-e17876ec002f976572b6ac102dc113024669a45c.tar.gz nova-e17876ec002f976572b6ac102dc113024669a45c.tar.xz nova-e17876ec002f976572b6ac102dc113024669a45c.zip |
fixed lp715427
-rw-r--r-- | nova/network/manager.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nova/network/manager.py b/nova/network/manager.py index b36dd59cf..39da031eb 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -563,6 +563,16 @@ class VlanManager(NetworkManager): # NOTE(vish): This makes ports unique accross the cloud, a more # robust solution would be to make them unique per ip net['vpn_public_port'] = vpn_start + index + network_ref = None + try: + network_ref = db.network_get_by_cidr(context, cidr) + except exception.NotFound: + pass + + if network_ref is not None: + raise ValueError(_('Network with cidr %s already exists' % + cidr)) + network_ref = self.db.network_create_safe(context, net) if network_ref: self._create_fixed_ips(context, network_ref['id']) |