v2v: fix regex replacement in grub2_update_console

The replacement string was wrong. There are only two match groups in the
regular expression, not three.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
This commit is contained in:
Tomáš Golembiovský
2016-08-06 20:04:53 +02:00
committed by Pino Toscano
parent 56e5cf14e9
commit 4ddc0add85

View File

@@ -1057,9 +1057,9 @@ let rec convert ~keep_serial_console (g : G.guestfs) inspect source rcaps =
if Str.string_match rex grub_cmdline 0 then (
let new_grub_cmdline =
if not remove then
Str.global_replace rex "\\1console=ttyS0\\3" grub_cmdline
Str.global_replace rex "\\1console=ttyS0\\2" grub_cmdline
else
Str.global_replace rex "\\1\\3" grub_cmdline in
Str.global_replace rex "\\1\\2" grub_cmdline in
g#aug_set path new_grub_cmdline;
g#aug_save ();