Support dataplane subnet mask & latency histogram
[samplevnf.git] / VNFs / DPPD-PROX / helper-scripts / rapid / stackdeployment.py
index 3d05ee7..925fd8b 100755 (executable)
@@ -75,7 +75,7 @@ class StackDeployment(object):
                     for name in server_group_output:
                         self.names.append(name)
 
-    def print_paramDict(self, user, push_gateway):
+    def print_paramDict(self, user, dataplane_subnet_mask):
         if not(len(self.dp_ips) == len(self.dp_macs) == len(self.mngmt_ips)):
             sys.exit()
         _ENV_FILE_DIR = os.path.dirname(os.path.realpath(__file__))
@@ -90,9 +90,11 @@ class StackDeployment(object):
                 env_file.write('admin_ip = {}\n'.format(str(self.mngmt_ips[count])))
                 if type(self.dp_ips[count]) == list:
                     for i, dp_ip in enumerate(self.dp_ips[count], start = 1):
-                        env_file.write('dp_ip{} = {}\n'.format(i, str(dp_ip)))
+                        env_file.write('dp_ip{} = {}/{}\n'.format(i, str(dp_ip),
+                            dataplane_subnet_mask))
                 else:
-                    env_file.write('dp_ip1 = {}\n'.format(str(self.dp_ips[count])))
+                    env_file.write('dp_ip1 = {}/{}\n'.format(str(self.dp_ips[count]),
+                        dataplane_subnet_mask))
                 if type(self.dp_macs[count]) == list:
                     for i, dp_mac in enumerate(self.dp_macs[count], start = 1):
                         env_file.write('dp_mac{} = {}\n'.format(i, str(dp_mac)))
@@ -106,7 +108,6 @@ class StackDeployment(object):
             env_file.write('[Varia]\n')
             env_file.write('vim = OpenStack\n')
             env_file.write('stack = {}\n'.format(self.stack.stack_name))
-            env_file.write('pushgateway = {}\n'.format(push_gateway))
 
     def create_stack(self, stack_name, stack_file_path, param_file):
         files, template = template_utils.process_template_path(stack_file_path)
@@ -157,6 +158,6 @@ class StackDeployment(object):
                 self.create_key()
             self.stack = self.create_stack(stack_name, heat_template, heat_param)
 
-    def generate_env_file(self, user = 'centos', push_gateway = None):
+    def generate_env_file(self, user = 'centos', dataplane_subnet_mask = '24'):
         self.generate_paramDict()
-        self.print_paramDict(user, push_gateway)
+        self.print_paramDict(user, dataplane_subnet_mask)