Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: fix the bug of radowgw-admin zonegroup set requires realm #19061

Merged
merged 1 commit into from Jan 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/rgw/rgw_admin.cc
Expand Up @@ -3686,7 +3686,9 @@ int main(int argc, const char **argv)
{
RGWRealm realm(realm_id, realm_name);
int ret = realm.init(g_ceph_context, store);
if (ret < 0) {
bool default_realm_not_exist = (ret == -ENOENT && realm_id.empty() && realm_name.empty());

if (ret < 0 && !default_realm_not_exist ) {
cerr << "failed to init realm: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
Expand All @@ -3701,7 +3703,7 @@ int main(int argc, const char **argv)
if (ret < 0) {
return 1;
}
if (zonegroup.realm_id.empty()) {
if (zonegroup.realm_id.empty() && !default_realm_not_exist) {
zonegroup.realm_id = realm.get_id();
}
ret = zonegroup.create();
Expand Down