+
+ def create_vpp_cfg_in_container(self, vat_template_file, **args):
+ """Create VPP exec config for a container on given node.
+
+ :param vat_template_file: Template file name of a VAT script.
+ :param args: Parameters for VAT script.
+ :type vat_template_file: str
+ :type args: dict
+ """
+ ssh = SSH()
+ ssh.connect(self._node)
+
+ vat_file_path = '{}/{}'.format(Constants.RESOURCES_TPL_VAT,
+ vat_template_file)
+
+ with open(vat_file_path, 'r') as template_file:
+ cmd_template = template_file.readlines()
+ for line_tmpl in cmd_template:
+ vat_cmd = line_tmpl.format(**args)
+ ssh.exec_command('echo "{0}" | '
+ 'sudo lxc-attach --name {1} -- '
+ '/bin/sh -c "/bin/cat >> /tmp/running.exec"'
+ .format(vat_cmd.replace('\n', ''),
+ self._container_name))