Skip to content

Commit

Permalink
Handle VMs with whitespace in the name
Browse files Browse the repository at this point in the history
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 <hkumar@d4devops.org>
  • Loading branch information
hkumarmk committed Jan 25, 2016
1 parent aa7686e commit dd0c8bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/vnsw/agent/port_ipc/vrouter-port-control
Expand Up @@ -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 *
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit dd0c8bb

Please sign in to comment.