diff --git a/qa/tasks/radosgw_admin.py b/qa/tasks/radosgw_admin.py index 8e744e3b6628e..f23a3b9ef4092 100644 --- a/qa/tasks/radosgw_admin.py +++ b/qa/tasks/radosgw_admin.py @@ -908,7 +908,7 @@ def task(ctx, config): stdin=StringIO(json.dumps(out)), check_status=True) - (err, out) = rgwadmin(ctx, client, ['zone', 'get','--rgw-zone','default']) + (err, out) = rgwadmin(ctx, client, ['zone', 'get']) assert len(out) > 0 assert len(out['placement_pools']) == orig_placement_pools + 1 @@ -918,6 +918,9 @@ def task(ctx, config): (err, out) = rgwadmin(ctx, client, zonecmd, check_status=True) + # TESTCASE 'zonegroup-info', 'zonegroup', 'get', 'get zonegroup info', 'succeeds' + (err, out) = rgwadmin(ctx, client, ['zonegroup', 'get'], check_status=True) + import sys from tasks.radosgw_admin import task from teuthology.config import config diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index cfcacfbd252b8..184134287a739 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -482,9 +482,9 @@ int RGWZoneGroup::read_default_id(string& default_id, bool old_format) /* try using default realm */ RGWRealm realm; int ret = realm.init(cct, store); + // no default realm exist if (ret < 0) { - ldout(cct, 10) << "could not read realm id: " << cpp_strerror(-ret) << dendl; - return -ENOENT; + return read_id(default_zonegroup_name, default_id); } realm_id = realm.get_id(); } @@ -1808,9 +1808,9 @@ int RGWZoneParams::read_default_id(string& default_id, bool old_format) /* try using default realm */ RGWRealm realm; int ret = realm.init(cct, store); + //no default realm exist if (ret < 0) { - ldout(cct, 10) << "could not read realm id: " << cpp_strerror(-ret) << dendl; - return -ENOENT; + return read_id(default_zone_name, default_id); } realm_id = realm.get_id(); }