提交 b2c9d77b 编写于 作者: P Peter Krempa

vsh: Tweak error message for scaled integers

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
上级 0c8e3b22
...@@ -205,7 +205,7 @@ compare exp-err err || fail=1 ...@@ -205,7 +205,7 @@ compare exp-err err || fail=1
# Non-numeric value # Non-numeric value
cat <<\EOF > exp-err || framework_failure 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 EOF
virsh -q -c $test_url setmaxmem test abc >out 2>err && fail=1 virsh -q -c $test_url setmaxmem test abc >out 2>err && fail=1
test -s out && fail=1 test -s out && fail=1
...@@ -213,7 +213,7 @@ compare exp-err err || fail=1 ...@@ -213,7 +213,7 @@ compare exp-err err || fail=1
# Numeric value with invalid suffix # Numeric value with invalid suffix
cat <<\EOF > exp-err || framework_failure 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 EOF
virsh -q -c $test_url setmaxmem test 42WB >out 2>err && fail=1 virsh -q -c $test_url setmaxmem test 42WB >out 2>err && fail=1
test -s out && fail=1 test -s out && fail=1
...@@ -232,7 +232,7 @@ test -s err && fail=1 ...@@ -232,7 +232,7 @@ test -s err && fail=1
# Negative numeric value # Negative numeric value
cat <<\EOF > exp-err || framework_failure 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 EOF
virsh -q -c $test_url setmaxmem test -1 >out 2>err && fail=1 virsh -q -c $test_url setmaxmem test -1 >out 2>err && fail=1
test -s out && fail=1 test -s out && fail=1
......
...@@ -1147,8 +1147,8 @@ vshCommandOptScaledInt(vshControl *ctl, const vshCmd *cmd, ...@@ -1147,8 +1147,8 @@ vshCommandOptScaledInt(vshControl *ctl, const vshCmd *cmd,
virScaleInteger(value, end, scale, max) < 0) virScaleInteger(value, end, scale, max) < 0)
{ {
vshError(ctl, vshError(ctl,
_("Numeric value '%s' for <%s> option is malformed or out of range"), _("Scaled numeric value '%s' for <%s> option is malformed or "
arg->data, name); "out of range"), arg->data, name);
ret = -1; ret = -1;
} else { } else {
ret = 1; ret = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册