Juan Hernandez has submitted this change and it was merged.

Change subject: cli: Escape comma in values
......................................................................


cli: Escape comma in values

When a command line option uses a value with several items we use the
comman character as the delimiter of name value pairs, for example:

  # update vm myvm --cpu-cpu_tune-vcpu_pin "vcpu_pin.vcpu=0,vcpu_pin.cpu_set=0"

But some values may actually contain commas, for example the "cpu_set"
value may contain a list of CPU indexes separated by commas:

  # update vm myvm --cpu-cpu_tune-vcpu_pin 
"vcpu_pin.vcpu=0,vcpu_pin.cpu_set=0,1"

The CLI can't currently support this, as it assumes that "1" is a name,
instead of taking it as part of the value.

To allow this kind of values this patch introduces the backslash as a
way to escape the delimiter (the comma), so that the command can be
written as follows:

  # update vm myvm --cpu-cpu_tune-vcpu_pin 
"vcpu_pin.vcpu=0,vcpu_pin.cpu_set=0\,1"

Change-Id: I4bcc5944e3f4236b3495acc02801acae7ec82eb2
Bug-Url: https://bugzilla.redhat.com/1088914
Signed-off-by: Juan Hernandez <[email protected]>
---
M src/ovirtcli/command/command.py
1 file changed, 44 insertions(+), 2 deletions(-)

Approvals:
  Michael Pasternak: Looks good to me, approved
  Juan Hernandez: Verified



-- 
To view, visit http://gerrit.ovirt.org/27078
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4bcc5944e3f4236b3495acc02801acae7ec82eb2
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: [email protected]
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to