提交 45d51681 编写于 作者: P Peter Krempa

net: leaseshelper: Ignore corrupted lease file and rewrite it

Instead of reporting an error and terminating, rewrite the file with
the newly learned info.
上级 f1385e22
......@@ -274,14 +274,14 @@ main(int argc, char **argv)
if (custom_lease_file_len) {
if (!(leases_array = virJSONValueFromString(lease_entries))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("invalid json in file: %s"), custom_lease_file);
goto cleanup;
}
if ((size = virJSONValueArraySize(leases_array)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("couldn't fetch array of leases"));
goto cleanup;
_("invalid json in file: %s, rewriting it"),
custom_lease_file);
} else {
if ((size = virJSONValueArraySize(leases_array)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("couldn't fetch array of leases"));
goto cleanup;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册