From: garciadeblas Date: Thu, 26 Jan 2017 14:35:55 +0000 (+0000) Subject: Randomize default subnet CIDR in vimconn_openstack. Fixes bug 179 X-Git-Tag: v1.1.0~12 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F1028%2F2;p=osm%2FRO.git Randomize default subnet CIDR in vimconn_openstack. Fixes bug 179 Signed-off-by: garciadeblas --- diff --git a/vimconn_openstack.py b/vimconn_openstack.py index 61d4b438..f9a2185c 100644 --- a/vimconn_openstack.py +++ b/vimconn_openstack.py @@ -34,6 +34,7 @@ import logging import netaddr import time import yaml +import random from novaclient import client as nClient_v2, exceptions as nvExceptions, api_versions as APIVersion import keystoneclient.v2_0.client as ksClient_v2 @@ -305,8 +306,9 @@ class vimconnector(vimconn.vimconnector): if not ip_profile: ip_profile = {} if 'subnet_address' not in ip_profile: - #Fake subnet is required - ip_profile['subnet_address'] = "192.168.111.0/24" + #Fake subnet is required + subnet_rand = random.randint(0, 255) + ip_profile['subnet_address'] = "192.168.{}.0/24".format(subnet_rand) if 'ip_version' not in ip_profile: ip_profile['ip_version'] = "IPv4" subnet={"name":net_name+"-subnet",