]> xenbits.xensource.com Git - libvirt.git/commitdiff
vsh: Tweak error message for scaled integers
authorPeter Krempa <pkrempa@redhat.com>
Thu, 17 Mar 2016 14:40:43 +0000 (15:40 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 29 Mar 2016 13:28:46 +0000 (15:28 +0200)
It was too similar to the non-scaled alternative.

before:
error: Numeric value 'abc' for <size> option is malformed or out of range
after:
error: Scaled numeric value 'abc' for <size> option is malformed or out of range

tests/virsh-optparse
tools/vsh.c

index e032094691b0c928946e8cf9132b900002ecb843..0fc261dffb62139398f64d0c3427c9f9f2ec3b95 100755 (executable)
@@ -205,7 +205,7 @@ compare exp-err err || fail=1
 
 # Non-numeric value
 cat <<\EOF > exp-err || framework_failure
-error: Numeric value 'abc' for <size> option is malformed or out of range
+error: Scaled numeric value 'abc' for <size> option is malformed or out of range
 EOF
 virsh -q -c $test_url setmaxmem test abc >out 2>err && fail=1
 test -s out && fail=1
@@ -213,7 +213,7 @@ compare exp-err err || fail=1
 
 # Numeric value with invalid suffix
 cat <<\EOF > exp-err || framework_failure
-error: Numeric value '42WB' for <size> option is malformed or out of range
+error: Scaled numeric value '42WB' for <size> option is malformed or out of range
 EOF
 virsh -q -c $test_url setmaxmem test 42WB >out 2>err && fail=1
 test -s out && fail=1
@@ -232,7 +232,7 @@ test -s err && fail=1
 
 # Negative numeric value
 cat <<\EOF > exp-err || framework_failure
-error: Numeric value '-1' for <size> option is malformed or out of range
+error: Scaled numeric value '-1' for <size> option is malformed or out of range
 EOF
 virsh -q -c $test_url setmaxmem test -1 >out 2>err && fail=1
 test -s out && fail=1
index 4ce17279bb75cc546619b990f8e1b8f13a982ff2..047a0ccd854ba7f3ffac9069035d031186a89b90 100644 (file)
@@ -1147,8 +1147,8 @@ vshCommandOptScaledInt(vshControl *ctl, const vshCmd *cmd,
         virScaleInteger(value, end, scale, max) < 0)
     {
         vshError(ctl,
-                 _("Numeric value '%s' for <%s> option is malformed or out of range"),
-                 arg->data, name);
+                 _("Scaled numeric value '%s' for <%s> option is malformed or "
+                   "out of range"), arg->data, name);
         ret = -1;
     } else {
         ret = 1;