From 841a10577980bff37d957a31f7fc309c241991a5 Mon Sep 17 00:00:00 2001 From: hkumarmk Date: Mon, 30 Nov 2015 12:18:51 +0530 Subject: [PATCH] Handle VMs with whitespace in the name vrouter-port-control script fail when there is a whitespace in the vm name (in fact in any of the arguments). This patch add a regex based split on vrouter-port-control to fix that, so that it will pass the arguments with whitespace in it correctly. Change-Id: Ibf52dc23321d1c4c7f231cb5cd386afa495de0aa Fixes-Bug: #1519768 Signed-off-by: hkumarmk --- src/vnsw/agent/port_ipc/vrouter-port-control | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vnsw/agent/port_ipc/vrouter-port-control b/src/vnsw/agent/port_ipc/vrouter-port-control index e9eb0de83ca..73197be5d72 100755 --- a/src/vnsw/agent/port_ipc/vrouter-port-control +++ b/src/vnsw/agent/port_ipc/vrouter-port-control @@ -11,6 +11,7 @@ import json import os import errno import datetime +import re sys.path.insert(1, sys.path[0]+'/../api-venv/lib/python2.7/site-packages') from vnc_api.vnc_api import * @@ -78,7 +79,9 @@ class VrouterPortControl(object): # Turn off help, so we print all options in response to -h conf_parser = argparse.ArgumentParser(add_help = False) - args, remaining_argv = conf_parser.parse_known_args(args_str.split()) + args, remaining_argv = conf_parser.parse_known_args( + re.compile("\s+(?=\-\-)").split(args_str) + ) # Don't surpress add_help here so it will handle -h parser = argparse.ArgumentParser(