Skip to content

Commit

Permalink
Merge pull request #51415 from yuvalif/wip-yuval-fix-59698
Browse files Browse the repository at this point in the history
rgw/lua: add more info on package install errors
  • Loading branch information
yuvalif committed May 15, 2023
2 parents 9045195 + 3583035 commit fb28670
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rgw/rgw_appmain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ void rgw::AppMain::init_lua()
r = rgw::lua::install_packages(dpp, driver, null_yield, path,
failed_packages, output);
if (r < 0) {
dout(1) << "WARNING: failed to install lua packages from allowlist"
dout(1) << "WARNING: failed to install lua packages from allowlist. error: " << r
<< dendl;
}
if (!output.empty()) {
Expand Down
4 changes: 3 additions & 1 deletion src/rgw/rgw_lua.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int install_packages(const DoutPrefixProvider *dpp, rgw::sal::Driver* driver,
if (std::filesystem::remove_all(luarocks_path, ec)
== static_cast<std::uintmax_t>(-1) &&
ec != std::errc::no_such_file_or_directory) {
output.append("failed to clear luarock directory: ");
output.append("failed to clear luarocks directory: ");
output.append(ec.message());
output.append("\n");
return ec.value();
Expand All @@ -175,11 +175,13 @@ int install_packages(const DoutPrefixProvider *dpp, rgw::sal::Driver* driver,
return 0;
}
if (ret < 0) {
output.append("failed to get lua package list");
return ret;
}
// verify that luarocks exists
const auto p = bp::search_path("luarocks");
if (p.empty()) {
output.append("failed to find luarocks");
return -ECHILD;
}

Expand Down

0 comments on commit fb28670

Please sign in to comment.