Used `at` rather than `operator[]` in a few instances. Review: https://reviews.apache.org/r/57331
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/98c77228 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/98c77228 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/98c77228 Branch: refs/heads/master Commit: 98c772280d352f03e3bb0a69d30814ced3f4434a Parents: 63dd6b4 Author: Michael Park <[email protected]> Authored: Sun Mar 5 23:35:59 2017 -0800 Committer: Michael Park <[email protected]> Committed: Mon Mar 6 15:07:23 2017 -0800 ---------------------------------------------------------------------- src/master/http.cpp | 4 ++-- src/master/quota_handler.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/98c77228/src/master/http.cpp ---------------------------------------------------------------------- diff --git a/src/master/http.cpp b/src/master/http.cpp index e81c4c3..de2cc03 100644 --- a/src/master/http.cpp +++ b/src/master/http.cpp @@ -3470,7 +3470,7 @@ Future<Response> Master::Http::roles( Option<Role*> role = None(); if (master->roles.contains(name)) { - role = master->roles[name]; + role = master->roles.at(name); } array.values.push_back(model(name, weight, role)); @@ -3563,7 +3563,7 @@ Future<Response> Master::Http::getRoles( } if (master->roles.contains(name)) { - Role* role_ = master->roles[name]; + Role* role_ = master->roles.at(name); role.mutable_resources()->CopyFrom(role_->resources()); http://git-wip-us.apache.org/repos/asf/mesos/blob/98c77228/src/master/quota_handler.cpp ---------------------------------------------------------------------- diff --git a/src/master/quota_handler.cpp b/src/master/quota_handler.cpp index 11cca90..ce1f064 100644 --- a/src/master/quota_handler.cpp +++ b/src/master/quota_handler.cpp @@ -136,7 +136,7 @@ void Master::QuotaHandler::rescindOffers(const QuotaInfo& request) const int frameworksInRole = 0; if (master->roles.contains(role)) { - Role* roleState = master->roles[role]; + Role* roleState = master->roles.at(role); foreachvalue (const Framework* framework, roleState->frameworks) { if (framework->active()) { ++frameworksInRole; @@ -508,7 +508,7 @@ Future<http::Response> Master::QuotaHandler::_remove( const string& role, const Option<Principal>& principal) const { - return authorizeRemoveQuota(principal, master->quotas[role].info) + return authorizeRemoveQuota(principal, master->quotas.at(role).info) .then(defer(master->self(), [=](bool authorized) -> Future<http::Response> { return !authorized ? Forbidden() : __remove(role); }));
