On Windows, ceph will fail to parse config files that lack a
newline at the end.
To improve user experience, we're adding a newline ourselves before
parsing the content.
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
}
}
std::ifstream ifs{fname};
- const std::string buffer{std::istreambuf_iterator<char>(ifs),
- std::istreambuf_iterator<char>()};
+ std::string buffer{std::istreambuf_iterator<char>(ifs),
+ std::istreambuf_iterator<char>()};
+ #ifdef _WIN32
+ // We'll need to ensure that there's a new line at the end of the file,
+ // otherwise the config parsing will fail.
+ buffer.append("\n");
+ #endif
if (parse_buffer(buffer, warnings)) {
return 0;
} else {