[Libguestfs] [PATCH 02/13] syntax-check: fix error_message_period check

Hu Tao
2014-09-23T09:20:28Z

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
 resize/resize.ml     | 10 +++++-----
 sparsify/copying.ml  |  2 +-
 src/fuse.c           |  2 +-
 src/launch-libvirt.c |  4 ++--
 src/libvirt-domain.c |  2 +-
 v2v/convert_linux.ml |  6 +++---
 v2v/input_libvirt.ml |  4 ++--
 v2v/lib_ovf.ml       |  2 +-
 v2v/output_glance.ml |  2 +-
 v2v/output_rhev.ml   |  6 +++---
 v2v/v2v.ml           |  6 +++---
 11 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/resize/resize.ml b/resize/resize.ml
index 81bb270..a3ea9be 100644
--- a/resize/resize.ml
+++ b/resize/resize.ml
@@ -310,7 +310,7 @@ read the man page virt-resize(1).
     let infile        try (infile, URI.parse_uri infile)
       with Invalid_argument "URI.parse_uri" ->
-        error (f_"error parsing URI '%s'. Look for error messages
printed above.")
+        error (f_"error parsing URI '%s'. Look for error messages
printed above")
           infile in

     infile, outfile, align_first, alignment, copy_boot_loader,
@@ -406,7 +406,7 @@ read the man page virt-resize(1).
     | "msdos" -> MBR, "msdos"
     | "gpt" -> GPT, "gpt"
     | _ ->
-      error (f_"%s: unknown partition table type\nvirt-resize only
supports MBR (DOS) and GPT partition tables.")
+      error (f_"%s: unknown partition table type\nvirt-resize only
supports MBR (DOS) and GPT partition tables")
         (fst infile) in

   (* Build a data structure describing the source disk's partition layout.
*)
@@ -767,7 +767,7 @@ read the man page virt-resize(1).
      | None -> ()
      | Some dev ->
          if surplus < 0L then
-           error (f_"You cannot use --expand when there is no surplus
space to expand into.  You need to make the target disk larger by at least
%s.")
+           error (f_"You cannot use --expand when there is no surplus
space to expand into.  You need to make the target disk larger by at least
%s")
              (human_size (Int64.neg surplus));

          let option = "--expand" in
@@ -779,7 +779,7 @@ read the man page virt-resize(1).
      | None -> ()
      | Some dev ->
          if surplus > 0L then
-           error (f_"You cannot use --shrink when there is no deficit (see
'deficit' in the virt-resize(1) man page).");
+           error (f_"You cannot use --shrink when there is no deficit (see
'deficit' in the virt-resize(1) man page)");

          let option = "--shrink" in
          let p = find_partition ~option dev in
@@ -796,7 +796,7 @@ read the man page virt-resize(1).

     if surplus < 0L then (
       let deficit = Int64.neg surplus in
-      error (f_"There is a deficit of %Ld bytes (%s).  You need to make
the target disk larger by at least this amount or adjust your resizing
requests.")
+      error (f_"There is a deficit of %Ld bytes (%s).  You need to make
the target disk larger by at least this amount or adjust your resizing
requests")
       deficit (human_size deficit)
     );

diff --git a/sparsify/copying.ml b/sparsify/copying.ml
index 3940f1f..a4a82f1 100644
--- a/sparsify/copying.ml
+++ b/sparsify/copying.ml
@@ -67,7 +67,7 @@ let run indisk outdisk check_tmpdir compress convert

   (* Compression is not supported by raw output (RHBZ#852194). *)
   if output_format = "raw" && compress then
-    error (f_"--compress cannot be used for raw output.  Remove this
option or use --convert qcow2.");
+    error (f_"--compress cannot be used for raw output.  Remove this
option or use --convert qcow2");

   (* Use TMPDIR or --tmp parameter? *)
   let tmp_place diff --git a/src/fuse.c b/src/fuse.c
index 08a8784..f7a6e71 100644
--- a/src/fuse.c
+++ b/src/fuse.c
@@ -1065,7 +1065,7 @@ guestfs__mount_local_run (guestfs_h *g)
   r = guestfs_exists (g, "/");
   guestfs_pop_error_handler (g);
   if (r == -1) {
-    error (g, _("you must call 'guestfs_mount' first to mount a
filesystem on '/'.\nNote: '%s' is still mounted.  Use
'guestunmount %s' to clean up."),
+    error (g, _("you must call 'guestfs_mount' first to mount a
filesystem on '/'.\nNote: '%s' is still mounted.  Use
'guestunmount %s' to clean up"),
            g->localmountpoint, g->localmountpoint);
     return -1;
   }
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
index 706ae38..5a3159d 100644
--- a/src/launch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -1404,14 +1404,14 @@ construct_libvirt_xml_disk (guestfs_h *g,
         if (STREQ (format, "unknown")) {
           error (g, _("could not auto-detect the format.\n"
                       "If the format is known, pass the format to
libguestfs, eg. using the\n"
-                      "'--format' option, or via the optional
'format' argument to 'add-drive'."));
+                      "'--format' option, or via the optional
'format' argument to 'add-drive'"));
           return -1;
         }
       }
       else {
         error (g, _("could not auto-detect the format when using a
non-file protocol.\n"
                     "If the format is known, pass the format to
libguestfs, eg. using the\n"
-                    "'--format' option, or via the optional
'format' argument to 'add-drive'."));
+                    "'--format' option, or via the optional
'format' argument to 'add-drive'"));
         return -1;
       }

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 7e0a0d9..d4176f7 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -743,7 +743,7 @@ connect_live (guestfs_h *g, virDomainPtr dom)

   if (path == NULL) {
     error (g, _("this guest has no libvirt <channel> definition for
guestfsd\n"
-                "See ATTACHING TO RUNNING DAEMONS in guestfs(3) for
further information."));
+                "See ATTACHING TO RUNNING DAEMONS in guestfs(3) for
further information"));
     return -1;
   }

diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
index 2cd1688..9b25f69 100644
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -265,7 +265,7 @@ let rec convert ~verbose ~keep_serial_console (g :
G.guestfs) inspect source    );

   if installed_kernels = [] then
-    error (f_"no installed kernel packages were found.\n\nThis probably
indicates that %s was unable to inspect this guest properly.")
+    error (f_"no installed kernel packages were found.\n\nThis probably
indicates that %s was unable to inspect this guest properly")
       prog;

   (* Now the difficult bit.  Get the grub kernels.  The first in this
@@ -376,7 +376,7 @@ let rec convert ~verbose ~keep_serial_console (g :
G.guestfs) inspect source    );

   if grub_kernels = [] then
-    error (f_"no kernels were found in the grub configuration.\n\nThis
probably indicates that %s was unable to parse the grub configuration of this
guest.")
+    error (f_"no kernels were found in the grub configuration.\n\nThis
probably indicates that %s was unable to parse the grub configuration of this
guest")
       prog;

   (*----------------------------------------------------------------------*)
@@ -730,7 +730,7 @@ let rec convert ~verbose ~keep_serial_console (g :
G.guestfs) inspect source        fun { ki_is_xen_kernel = is_xen_kernel } ->
is_xen_kernel
     ) grub_kernels in
     if only_xen_kernels then
-      error (f_"only Xen kernels are installed in this guest.\n\nRead the
%s(1) manual, section \"XEN PARAVIRTUALIZED GUESTS\", to see what to
do.") prog;
+      error (f_"only Xen kernels are installed in this guest.\n\nRead the
%s(1) manual, section \"XEN PARAVIRTUALIZED GUESTS\", to see what to
do") prog;

     (* Enable the best non-Xen kernel, where "best" means the one
with
      * the highest version which supports virtio.
diff --git a/v2v/input_libvirt.ml b/v2v/input_libvirt.ml
index 9e8b510..ead10ec 100644
--- a/v2v/input_libvirt.ml
+++ b/v2v/input_libvirt.ml
@@ -30,7 +30,7 @@ open Utils
 let error_if_libvirt_backend ()    let libguestfs_backend = (new
Guestfs.guestfs ())#get_backend () in
   if libguestfs_backend = "libvirt" then (
-    error (f_"because of libvirt bug
https://bugzilla.redhat.com/show_bug.cgi?id=1134592 you must set this
environment variable:\n\nexport LIBGUESTFS_BACKEND=direct\n\nand then rerun the
virt-v2v command.")
+    error (f_"because of libvirt bug
https://bugzilla.redhat.com/show_bug.cgi?id=1134592 you must set this
environment variable:\n\nexport LIBGUESTFS_BACKEND=direct\n\nand then rerun the
virt-v2v command")
   )

 (* xen+ssh URLs use the SSH driver in CURL.  Currently this requires
@@ -40,7 +40,7 @@ let error_if_libvirt_backend ()  let error_if_no_ssh_agent ()
try ignore (Sys.getenv "SSH_AUTH_SOCK")
   with Not_found ->
-    error (f_"ssh-agent authentication has not been set up ($SSH_AUTH_SOCK
is not set).  Please read \"INPUT FROM RHEL 5 XEN\" in the virt-v2v(1)
man page.")
+    error (f_"ssh-agent authentication has not been set up ($SSH_AUTH_SOCK
is not set).  Please read \"INPUT FROM RHEL 5 XEN\" in the virt-v2v(1)
man page")

 class input_libvirt verbose libvirt_uri guest  object
diff --git a/v2v/lib_ovf.ml b/v2v/lib_ovf.ml
index fcba087..dec2ef8 100644
--- a/v2v/lib_ovf.ml
+++ b/v2v/lib_ovf.ml
@@ -161,7 +161,7 @@ let create_meta_files verbose output_alloc sd_uuid
image_uuid targets      fun ({ target_overlay = ov } as t) ->
       let size_in_sectors          if ov.ov_virtual_size &^ 511L <>
0L then
-          error (f_"the virtual size of the input disk %s is not an exact
multiple of 512 bytes.  The virtual size is: %Ld.\n\nThis probably means
something unexpected is going on, so please file a bug about this issue.")
+          error (f_"the virtual size of the input disk %s is not an exact
multiple of 512 bytes.  The virtual size is: %Ld.\n\nThis probably means
something unexpected is going on, so please file a bug about this issue")
             ov.ov_source.s_qemu_uri
             ov.ov_virtual_size;
         ov.ov_virtual_size /^ 512L in
diff --git a/v2v/output_glance.ml b/v2v/output_glance.ml
index c2b1a32..4b05214 100644
--- a/v2v/output_glance.ml
+++ b/v2v/output_glance.ml
@@ -47,7 +47,7 @@ object
      * program exits early.
      *)
     if Sys.command "glance image-list > /dev/null" <> 0 then
-      error (f_"glance: glance client is not installed or set up
correctly.  You may need to set environment variables or source a script to
enable authentication.  See preceding messages for details.");
+      error (f_"glance: glance client is not installed or set up
correctly.  You may need to set environment variables or source a script to
enable authentication.  See preceding messages for details");

     (* OpenStack only supports single image VMs, I think? *)
     let nr_targets = List.length targets in
diff --git a/v2v/output_rhev.ml b/v2v/output_rhev.ml
index bb77787..cfdc76e 100644
--- a/v2v/output_rhev.ml
+++ b/v2v/output_rhev.ml
@@ -49,7 +49,7 @@ let rec mount_and_check_storage_domain verbose domain_class os
sprintf "mount %s:%s %s" (quote server) (quote export) (quote mp) in
     if verbose then printf "%s\n%!" cmd;
     if Sys.command cmd <> 0 then
-      error (f_"mount command failed, see earlier errors.\n\nThis probably
means you didn't specify the right %s path [-os %s], or else you need to
rerun virt-v2v as root.") domain_class os;
+      error (f_"mount command failed, see earlier errors.\n\nThis probably
means you didn't specify the right %s path [-os %s], or else you need to
rerun virt-v2v as root") domain_class os;

     (* Make sure it is unmounted at exit. *)
     at_exit (fun () ->
@@ -86,7 +86,7 @@ and check_storage_domain verbose domain_class os mp      | []
->
       error (f_"there are no UUIDs in the %s (%s).  Is it really an OVirt
or RHEV-M %s?") domain_class os domain_class
     | _::_ ->
-      error (f_"there are multiple UUIDs in the %s (%s).  This is
unexpected, and may be a bug in virt-v2v or OVirt.") domain_class os in
+      error (f_"there are multiple UUIDs in the %s (%s).  This is
unexpected, and may be a bug in virt-v2v or OVirt") domain_class os in

   (* Check that the domain has been attached to a Data Center by
    * checking that the master/vms directory exists.
@@ -94,7 +94,7 @@ and check_storage_domain verbose domain_class os mp    let ()
let master_vms_dir = mp // uuid // "master" // "vms" in
     if not (is_directory master_vms_dir) then
-      error (f_"%s does not exist or is not a directory.\n\nMost likely
cause: Either the %s (%s) has not been attached to any Data Center, or the path
%s is not an %s at all.\n\nYou have to attach the %s to a Data Center using the
RHEV-M / OVirt user interface first.\n\nIf you don't know what the %s mount
point should be then you can also find this out through the RHEV-M user
interface.")
+      error (f_"%s does not exist or is not a directory.\n\nMost likely
cause: Either the %s (%s) has not been attached to any Data Center, or the path
%s is not an %s at all.\n\nYou have to attach the %s to a Data Center using the
RHEV-M / OVirt user interface first.\n\nIf you don't know what the %s mount
point should be then you can also find this out through the RHEV-M user
interface")
         master_vms_dir domain_class os os
         domain_class domain_class domain_class in

diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index 110c092..44639b6 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -176,7 +176,7 @@ let rec main ()           * early, not below, later.
          *)
         if format <> "raw" && format <>
"qcow2" then
-          error (f_"output format should be 'raw' or
'qcow2'.\n\nUse the '-of <format>' option to select a
different output format for the converted guest.\n\nOther output formats are not
supported at the moment, although might be considered in future.");
+          error (f_"output format should be 'raw' or
'qcow2'.\n\nUse the '-of <format>' option to select a
different output format for the converted guest.\n\nOther output formats are not
supported at the moment, although might be considered in future");

         (* output#prepare_targets will fill in the target_file field.
          * estimate_target_size will fill in the target_estimated_size field.
@@ -348,7 +348,7 @@ and inspect_source g root_choice    let root      match
roots with
     | [] ->
-      error (f_"no root device found in this operating system
image.");
+      error (f_"no root device found in this operating system
image");
     | [root] -> root
     | roots ->
       match root_choice with
@@ -378,7 +378,7 @@ and inspect_source g root_choice          List.nth roots (!i
- 1)

       | `Single ->
-        error (f_"multi-boot operating systems are not supported by
virt-v2v. Use the --root option to change how virt-v2v handles this.")
+        error (f_"multi-boot operating systems are not supported by
virt-v2v. Use the --root option to change how virt-v2v handles this")

       | `First ->
         List.hd roots
--
1.9.3