From 6b1d9ebb80478c1dfe0e974377bd4fb070a5d417 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 2 May 2016 11:36:58 -0400 Subject: [PATCH] rgw: RGWZoneGroup::remove_zone() takes zone id Signed-off-by: Casey Bodley (cherry picked from commit 3a451511fb38a5f1cd83ca3610c91141e7279f63) --- src/rgw/rgw_admin.cc | 2 +- src/rgw/rgw_rados.cc | 8 ++++---- src/rgw/rgw_rados.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 3e4bcba2790b6..928ba942a2fdf 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -3293,7 +3293,7 @@ int main(int argc, char **argv) cerr << "WARNING: failed to initialize zonegroup " << zonegroup_name << std::endl; continue; } - ret = zonegroup.remove_zone(zone); + ret = zonegroup.remove_zone(zone.get_id()); if (ret < 0 && ret != -ENOENT) { cerr << "failed to remove zone " << zone_name << " from zonegroup " << zonegroup.get_name() << ": " << cpp_strerror(-ret) << std::endl; diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 47ba96261c17d..44b8cbb3e007b 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -310,12 +310,12 @@ void RGWZoneGroup::post_process_params() } } -int RGWZoneGroup::remove_zone(const RGWZoneParams& zone_params) +int RGWZoneGroup::remove_zone(const std::string& zone_id) { - map::iterator iter = zones.find(zone_params.get_id()); - + map::iterator iter = zones.find(zone_id); if (iter == zones.end()) { - ldout(cct, 0) << "zone " << zone_params.get_name() << " " << zone_params.get_id() << "is not a part of zonegroup "<< name << dendl; + ldout(cct, 0) << "zone id " << zone_id << " is not a part of zonegroup " + << name << dendl; return -ENOENT; } diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 612a523570ed6..456cbc23bffd2 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -1155,7 +1155,7 @@ struct RGWZoneGroup : public RGWSystemMetaObj { int create_default(bool old_format = false); int equals(const string& other_zonegroup) const; int add_zone(const RGWZoneParams& zone_params, bool *is_master, bool *read_only, const list& endpoints); - int remove_zone(const RGWZoneParams& zone_params); + int remove_zone(const std::string& zone_id); int rename_zone(const RGWZoneParams& zone_params); const string& get_pool_name(CephContext *cct); const string get_default_oid(bool old_region_format = false); -- 2.39.5