mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
Migrate call sites to new strlib.
Assisted-by: Codex:GPT-5 Signed-off-by: Jesse F. Williamson <jfw@ibm.com>
This commit is contained in:
parent
b66e7c63b8
commit
f5dacf4340
@ -16,7 +16,7 @@
|
||||
#include "AuthMethodList.h"
|
||||
#include "common/debug.h"
|
||||
#include "include/ceph_fs.h" // for CEPH_AUTH_*
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include <algorithm> // for std::find()
|
||||
|
||||
@ -26,7 +26,7 @@ const static int dout_subsys = ceph_subsys_auth;
|
||||
AuthMethodList::AuthMethodList(CephContext *cct, std::string str)
|
||||
{
|
||||
std::list<std::string> sup_list;
|
||||
get_str_list(str, sup_list);
|
||||
ceph::split_str(str, sup_list);
|
||||
if (sup_list.empty()) {
|
||||
lderr(cct) << "WARNING: empty auth protocol list" << dendl;
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ void AuthRegistry::_parse_method_list(const string& s,
|
||||
std::vector<uint32_t> *v)
|
||||
{
|
||||
std::list<std::string> sup_list;
|
||||
get_str_list(s, sup_list);
|
||||
ceph::split_str(s, sup_list);
|
||||
if (sup_list.empty()) {
|
||||
lderr(cct) << "WARNING: empty auth protocol list" << dendl;
|
||||
}
|
||||
@ -90,7 +90,7 @@ void AuthRegistry::_parse_mode_list(const string& s,
|
||||
std::vector<uint32_t> *v)
|
||||
{
|
||||
std::list<std::string> sup_list;
|
||||
get_str_list(s, sup_list);
|
||||
ceph::split_str(s, sup_list);
|
||||
if (sup_list.empty()) {
|
||||
lderr(cct) << "WARNING: empty auth protocol list" << dendl;
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ using namespace std::literals::string_view_literals;
|
||||
#include "common/perf_counters.h"
|
||||
#include "common/admin_socket.h"
|
||||
#include "common/errno.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#define dout_subsys ceph_subsys_client
|
||||
|
||||
@ -2581,7 +2581,7 @@ void Client::populate_metadata(const std::string &mount_root)
|
||||
|
||||
// Apply any metadata from the user's configured overrides
|
||||
std::vector<std::string> tokens;
|
||||
get_str_vec(cct->_conf->client_metadata, ",", tokens);
|
||||
ceph::split_str(cct->_conf->client_metadata, ",", tokens);
|
||||
for (const auto &i : tokens) {
|
||||
auto eqpos = i.find("=");
|
||||
// Throw out anything that isn't of the form "<str>=<str>"
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
#include <boost/intrusive_ptr.hpp>
|
||||
#include <boost/smart_ptr/intrusive_ref_counter.hpp>
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/rados/librados.hpp"
|
||||
#include "cls_rgw_ops.h"
|
||||
#include "cls_rgw_const.h"
|
||||
@ -87,7 +87,7 @@ public:
|
||||
int from_string(std::string_view composed_marker, int shard_id) {
|
||||
value_by_shards.clear();
|
||||
std::vector<std::string> shards;
|
||||
get_str_vec(composed_marker, SHARDS_SEPARATOR.c_str(), shards);
|
||||
ceph::split_str(composed_marker, SHARDS_SEPARATOR.c_str(), shards);
|
||||
if (shards.size() > 1 && shard_id >= 0) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ int ErasureCodePluginRegistry::preload(const std::string &plugins,
|
||||
{
|
||||
std::lock_guard l(lock);
|
||||
list<string> plugins_list;
|
||||
get_str_list(plugins, plugins_list);
|
||||
ceph::split_str(plugins, plugins_list);
|
||||
for (list<string>::iterator i = plugins_list.begin();
|
||||
i != plugins_list.end();
|
||||
++i) {
|
||||
|
||||
@ -15,10 +15,11 @@
|
||||
|
||||
#include "include/ceph_assert.h"
|
||||
|
||||
#include <list>
|
||||
#include <sstream>
|
||||
|
||||
#include "include/compat.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/types.h" // for operator<<(std::list)
|
||||
#include "common/BackTrace.h"
|
||||
#include "common/Clock.h" // for ceph_clock_now()
|
||||
@ -45,7 +46,7 @@ namespace ceph {
|
||||
{
|
||||
ceph_assert(!g_assert_context);
|
||||
g_assert_context = cct;
|
||||
const auto supressions = get_str_list(
|
||||
const auto supressions = ceph::split_str<std::list>(
|
||||
g_assert_context->_conf.get_val<std::string>("ceph_assert_supresssions"));
|
||||
if (!supressions.empty()) {
|
||||
lderr(g_assert_context) << "WARNING: supressions for ceph_assert present: "
|
||||
@ -90,7 +91,7 @@ namespace ceph {
|
||||
}
|
||||
|
||||
// bypass the abort?
|
||||
const auto supressions = get_str_list(
|
||||
const auto supressions = ceph::split_str<std::list>(
|
||||
g_assert_context->_conf.get_val<std::string>("ceph_assert_supresssions"));
|
||||
should_abort = std::none_of(
|
||||
std::begin(supressions), std::end(supressions),
|
||||
@ -185,7 +186,7 @@ namespace ceph {
|
||||
}
|
||||
|
||||
// bypass the abort?
|
||||
const auto supressions = get_str_list(
|
||||
const auto supressions = ceph::split_str<std::list>(
|
||||
g_assert_context->_conf.get_val<std::string>("ceph_assert_supresssions"));
|
||||
should_abort = std::none_of(
|
||||
std::begin(supressions), std::end(supressions),
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
#include "common/config.h"
|
||||
#include "common/strtol.h" // for strict_strtof()
|
||||
#include "common/version.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
@ -109,7 +109,7 @@ void env_to_vec(std::vector<const char*>& args, const char *name)
|
||||
g_str_vec_lock.unlock();
|
||||
return;
|
||||
}
|
||||
get_str_vec(p, " ", g_str_vec);
|
||||
ceph::split_str(p, " ", g_str_vec);
|
||||
}
|
||||
|
||||
std::vector<const char*> env;
|
||||
@ -199,7 +199,7 @@ bool parse_ip_port_vec(const char *s, std::vector<entity_addrvec_t>& vec, int ty
|
||||
{
|
||||
// first split by [ ;], which are not valid for an addrvec
|
||||
std::list<std::string> items;
|
||||
get_str_list(s, " ;", items);
|
||||
ceph::split_str(s, " ;", items);
|
||||
|
||||
for (auto& i : items) {
|
||||
const char *s = i.c_str();
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
#include "log/Log.h"
|
||||
|
||||
#include "auth/Crypto.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "common/config.h"
|
||||
#include "common/config_obs.h"
|
||||
#include "common/PluginRegistry.h"
|
||||
@ -423,7 +423,7 @@ public:
|
||||
cct->_experimental_features.emplace(std::string{feature});
|
||||
};
|
||||
for_each_substr(conf->enable_experimental_unrecoverable_data_corrupting_features,
|
||||
";,= \t", add_experimental_feature);
|
||||
add_experimental_feature);
|
||||
|
||||
if (getenv("CEPH_DEV") == NULL) {
|
||||
if (!cct->_experimental_features.empty()) {
|
||||
@ -617,7 +617,7 @@ int CephContext::_do_command(
|
||||
r = -EINVAL;
|
||||
} else {
|
||||
// val may be multiple words
|
||||
auto valstr = str_join(val, " ");
|
||||
auto valstr = ceph::str_join(val, " ");
|
||||
r = _conf.set_val(var.c_str(), valstr.c_str());
|
||||
if (r < 0) {
|
||||
ss << "error setting '" << var << "' to '" << valstr << "': "
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
#include "include/types.h" // for operator<<(std::vector)
|
||||
#include "json_spirit/json_spirit.h"
|
||||
|
||||
#include <list>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
|
||||
@ -536,7 +537,7 @@ bool arg_in_range(T value, const arg_desc_t& desc, std::ostream& os) {
|
||||
if (range == desc.end()) {
|
||||
return true;
|
||||
}
|
||||
auto min_max = get_str_list(string(range->second), "|");
|
||||
auto min_max = ceph::split_str<std::list>(string(range->second), "|");
|
||||
auto min = str_to_num<T>(min_max.front());
|
||||
auto max = std::numeric_limits<T>::max();
|
||||
if (min_max.size() > 1) {
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
#include "common/common_init.h"
|
||||
#include "common/config.h"
|
||||
#include "common/config_obs.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/stringify.h"
|
||||
#include "osd/osd_types.h"
|
||||
#include "common/errno.h"
|
||||
@ -103,7 +103,7 @@ int ceph_resolve_file_search(const std::string& filename_list,
|
||||
std::string& result)
|
||||
{
|
||||
list<string> ls;
|
||||
get_str_list(filename_list, ";,", ls);
|
||||
ceph::split_str(filename_list, ";,", ls);
|
||||
|
||||
int ret = -ENOENT;
|
||||
list<string>::iterator iter;
|
||||
@ -438,7 +438,7 @@ md_config_t::get_conffile_paths(const ConfigValues& values,
|
||||
}
|
||||
|
||||
std::list<std::string> paths;
|
||||
get_str_list(conf_files_str, ";,", paths);
|
||||
ceph::split_str(conf_files_str, ";,", paths);
|
||||
for (auto i = paths.begin(); i != paths.end(); ) {
|
||||
string& path = *i;
|
||||
if (path.find("$data_dir") != path.npos &&
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "global/global_context.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/scope_guard.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include <string>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "msg/msg_types.h"
|
||||
#include "include/uuid.h"
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
#include <bitset>
|
||||
#include <ifaddrs.h> // for struct ifaddrs
|
||||
#include <list>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#ifdef _WIN32
|
||||
@ -33,7 +34,7 @@
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "include/ipaddr.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "common/ceph_context.h"
|
||||
#ifndef WITH_CRIMSON
|
||||
#include "common/config.h"
|
||||
@ -162,8 +163,8 @@ const struct sockaddr *find_ip_in_subnet_list(
|
||||
const std::string &interfaces,
|
||||
int numa_node)
|
||||
{
|
||||
const auto ifs = get_str_list(interfaces);
|
||||
const auto nets = get_str_list(networks);
|
||||
const auto ifs = ceph::split_str<std::list>(interfaces);
|
||||
const auto nets = ceph::split_str<std::list>(networks);
|
||||
if (!ifs.empty() && nets.empty()) {
|
||||
lderr(cct) << "interface names specified but not network names" << dendl;
|
||||
exit(1);
|
||||
@ -613,7 +614,7 @@ int get_iface_numa_node(
|
||||
int bond_node = -1;
|
||||
std::vector<std::string> sv;
|
||||
std::string ifacestr = buf;
|
||||
get_str_vec(ifacestr, " ", sv);
|
||||
ceph::split_str(ifacestr, " ", sv);
|
||||
for (auto& iter : sv) {
|
||||
int bn = -1;
|
||||
r = get_iface_numa_node(iter, &bn);
|
||||
@ -642,7 +643,7 @@ bool is_addr_in_subnet(
|
||||
const std::string &networks,
|
||||
const entity_addr_t &addr)
|
||||
{
|
||||
const auto nets = get_str_list(networks);
|
||||
const auto nets = ceph::split_str<std::list>(networks);
|
||||
ceph_assert(!nets.empty());
|
||||
unsigned ipv = CEPH_PICK_ADDRESS_IPV4;
|
||||
struct sockaddr_in6 public_addr6;
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "include/str_map.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ void CrushLocation::_parse(const std::string& s)
|
||||
{
|
||||
std::multimap<std::string, std::string> new_crush_location;
|
||||
std::vector<std::string> lvec;
|
||||
get_str_vec(s, ";, \t", lvec);
|
||||
ceph::split_str(s, ";, \t", lvec);
|
||||
int r = CrushWrapper::parse_loc_multimap(lvec, &new_crush_location);
|
||||
if (r < 0) {
|
||||
logger().error("CrushWrapper::parse_loc_multimap error, keeping original\
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
#include "common/SubProcess.h"
|
||||
#include "include/common_fwd.h"
|
||||
#include "include/compat.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include <boost/algorithm/string/trim.hpp>
|
||||
|
||||
@ -29,7 +29,7 @@ int CrushLocation::_parse(const std::string& s)
|
||||
{
|
||||
std::multimap<std::string,std::string> new_crush_location;
|
||||
std::vector<std::string> lvec;
|
||||
get_str_vec(s, ";, \t", lvec);
|
||||
ceph::split_str(s, ";, \t", lvec);
|
||||
int r = CrushWrapper::parse_loc_multimap(lvec, &new_crush_location);
|
||||
if (r < 0) {
|
||||
lderr(cct) << "warning: crush_location '" << cct->_conf->crush_location
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include "ErasureCodePlugin.h"
|
||||
#include "common/errno.h"
|
||||
#include "include/dlfcn_compat.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/ceph_assert.h"
|
||||
|
||||
using namespace std;
|
||||
@ -211,7 +211,7 @@ int ErasureCodePluginRegistry::preload(const std::string &plugins,
|
||||
{
|
||||
std::lock_guard l{lock};
|
||||
list<string> plugins_list;
|
||||
get_str_list(plugins, plugins_list);
|
||||
ceph::split_str(plugins, plugins_list);
|
||||
for (list<string>::iterator i = plugins_list.begin();
|
||||
i != plugins_list.end();
|
||||
++i) {
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
#include "common/debug.h"
|
||||
#include "common/hostname.h"
|
||||
#include "common/perf_counters.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "global/global_context.h"
|
||||
#include "global/global_init.h"
|
||||
#include "include/common_fwd.h"
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
#include "ExtBlkDevPlugin.h"
|
||||
#include "common/errno.h"
|
||||
#include "include/dlfcn_compat.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/ceph_assert.h"
|
||||
#include "common/ceph_context.h"
|
||||
#include "common/debug.h"
|
||||
@ -200,7 +200,7 @@ namespace ceph {
|
||||
dout(10) << "starting preload of extblkdev plugins: " << plugins << dendl;
|
||||
|
||||
list<string> plugins_list;
|
||||
get_str_list(plugins, plugins_list);
|
||||
ceph::split_str(plugins, plugins_list);
|
||||
|
||||
auto registry = cct->get_plugin_registry();
|
||||
{
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
#include "global/pidfile.h"
|
||||
#include "global/signal_handler.h"
|
||||
#include "include/compat.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "log/Log.h"
|
||||
#include "mon/MonClient.h"
|
||||
|
||||
@ -636,7 +636,7 @@ int global_init_preload_erasure_code(const CephContext *cct)
|
||||
|
||||
// validate that this is a not a legacy plugin
|
||||
std::list<string> plugins_list;
|
||||
get_str_list(plugins, plugins_list);
|
||||
ceph::split_str(plugins, plugins_list);
|
||||
for (auto i = plugins_list.begin(); i != plugins_list.end(); ++i) {
|
||||
string plugin_name = *i;
|
||||
string replacement = "";
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include "common/strtol.h"
|
||||
#include "include/common_fwd.h"
|
||||
#include "include/scope_guard.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/stringify.h"
|
||||
#include "include/str_map.h"
|
||||
#include "include/utime.h"
|
||||
@ -520,7 +520,7 @@ int RocksDBStore::load_rocksdb_options(bool create_if_missing, rocksdb::Options&
|
||||
try {
|
||||
if (kv_options.count("db_paths")) {
|
||||
list<string> paths;
|
||||
get_str_list(kv_options["db_paths"], "; \t", paths);
|
||||
ceph::split_str(kv_options["db_paths"], "; \t", paths);
|
||||
for (auto& p : paths) {
|
||||
size_t pos = p.find(',');
|
||||
if (pos == std::string::npos) {
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
#include "common/config.h"
|
||||
#include "common/version.h"
|
||||
#include "mon/MonClient.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/stringify.h"
|
||||
#include "include/object.h"
|
||||
#include "log/Log.h"
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
#include "include/compat.h"
|
||||
#include "include/Context.h"
|
||||
#include "include/types.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/util.h"
|
||||
|
||||
#include "common/Clock.h"
|
||||
@ -207,7 +207,7 @@ void MDSDaemon::asok_command(
|
||||
string heapcmd;
|
||||
cmd_getval(cmdmap, "heapcmd", heapcmd);
|
||||
vector<string> heapcmd_vec;
|
||||
get_str_vec(heapcmd, heapcmd_vec);
|
||||
ceph::split_str(heapcmd, heapcmd_vec);
|
||||
string value;
|
||||
if (cmd_getval(cmdmap, "value", value)) {
|
||||
heapcmd_vec.push_back(value);
|
||||
@ -221,7 +221,7 @@ void MDSDaemon::asok_command(
|
||||
string arg;
|
||||
cmd_getval(cmdmap, "arg", arg);
|
||||
vector<string> argvec;
|
||||
get_str_vec(arg, argvec);
|
||||
ceph::split_str(arg, argvec);
|
||||
cpu_profiler_handle_command(argvec, ss);
|
||||
r = 0;
|
||||
} else {
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
#include "MgrSession.h"
|
||||
|
||||
#include "include/stringify.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "auth/RotatingKeyRing.h"
|
||||
#include "json_spirit/json_spirit_writer.h"
|
||||
|
||||
@ -1800,7 +1800,7 @@ bool DaemonServer::_handle_command(
|
||||
string whostr;
|
||||
cmd_getval(cmdctx->cmdmap, "who", whostr);
|
||||
std::vector<string> pvec;
|
||||
get_str_vec(prefix, pvec);
|
||||
ceph::split_str(prefix, pvec);
|
||||
|
||||
std::set<int> osds;
|
||||
if (whostr == "*" || whostr == "all" || whostr == "any") {
|
||||
@ -2415,7 +2415,7 @@ bool DaemonServer::_handle_command(
|
||||
prefix == "osd pool cancel-force-recovery" ||
|
||||
prefix == "osd pool cancel-force-backfill") {
|
||||
std::vector<string> vs;
|
||||
get_str_vec(prefix, vs);
|
||||
ceph::split_str(prefix, vs);
|
||||
auto& granularity = vs.front();
|
||||
auto& forceop = vs.back();
|
||||
std::vector<pg_t> pgs;
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
#include "common/signal.h"
|
||||
#include "common/cmdparse.h"
|
||||
#include "include/compat.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "perfglue/heap_profiler.h"
|
||||
|
||||
#include "include/stringify.h"
|
||||
@ -162,7 +162,7 @@ int MgrStandby::asok_command(std::string_view cmd, const cmdmap_t& cmdmap,
|
||||
std::string heapcmd;
|
||||
cmd_getval(cmdmap, "heapcmd", heapcmd);
|
||||
std::vector<std::string> cmd_vec;
|
||||
get_str_vec(heapcmd, cmd_vec);
|
||||
ceph::split_str(heapcmd, cmd_vec);
|
||||
std::string val;
|
||||
if (cmd_getval(cmdmap, "value", val)) {
|
||||
cmd_vec.push_back(val);
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include "include/stringify.h"
|
||||
#include "common/BackTrace.h"
|
||||
#include "common/JSONFormatter.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "global/signal_handler.h"
|
||||
|
||||
#include "common/debug.h"
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "include/stringify.h"
|
||||
#include "common/errno.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include "BaseMgrModule.h"
|
||||
#include "PyOSDMap.h"
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
#include "common/safe_io.h"
|
||||
#include "common/strtol.h"
|
||||
#include "include/ceph_assert.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/str_map.h"
|
||||
#include "include/compat.h"
|
||||
#include "include/utime_fmt.h"
|
||||
@ -1047,7 +1047,7 @@ bool LogMonitor::prepare_command(MonOpRequestRef op)
|
||||
string level_str = cmd_getval_or<string>(cmdmap, "level", "info");
|
||||
le.prio = LogEntry::str_to_level(level_str);
|
||||
le.channel = CLOG_CHANNEL_DEFAULT;
|
||||
le.msg = str_join(logtext, " ");
|
||||
le.msg = ceph::str_join(logtext, " ");
|
||||
pending_keys.insert(le.key());
|
||||
pending_log.insert(pair<utime_t,LogEntry>(le.stamp, le));
|
||||
wait_for_commit(op, new Monitor::C_Command(
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
#include "messages/MGenericMessage.h"
|
||||
|
||||
#include "include/ceph_assert.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/stringify.h"
|
||||
#include "include/util.h" // for dump_services()
|
||||
#include "mds/cephfs_features.h"
|
||||
|
||||
@ -83,7 +83,7 @@
|
||||
#include "include/stringify.h"
|
||||
#include "include/color.h"
|
||||
#include "include/ceph_fs.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/util.h" // for collect_sys_info(), dump_services()
|
||||
|
||||
#include "OSDMonitor.h"
|
||||
@ -534,7 +534,7 @@ will start to track new ops received afterwards.";
|
||||
goto abort;
|
||||
}
|
||||
std::vector<std::string> cmd_vec;
|
||||
get_str_vec(cmd, cmd_vec);
|
||||
ceph::split_str(cmd, cmd_vec);
|
||||
string val;
|
||||
if (cmd_getval(cmdmap, "value", val)) {
|
||||
cmd_vec.push_back(val);
|
||||
@ -953,7 +953,7 @@ int Monitor::preinit()
|
||||
if (!has_ever_joined) {
|
||||
// impose initial quorum restrictions?
|
||||
list<string> initial_members;
|
||||
get_str_list(g_conf()->mon_initial_members, initial_members);
|
||||
ceph::split_str(g_conf()->mon_initial_members, initial_members);
|
||||
|
||||
if (!initial_members.empty()) {
|
||||
dout(1) << " initial_members " << initial_members << ", filtering seed monmap" << dendl;
|
||||
@ -3616,7 +3616,7 @@ void Monitor::handle_command(MonOpRequestRef op)
|
||||
string format = cmd_getval_or<string>(cmdmap, "format", "plain");
|
||||
boost::scoped_ptr<Formatter> f(Formatter::create(format));
|
||||
|
||||
get_str_vec(prefix, fullcmd);
|
||||
ceph::split_str(prefix, fullcmd);
|
||||
|
||||
// make sure fullcmd is not empty.
|
||||
// invalid prefix will cause empty vector fullcmd.
|
||||
@ -3968,7 +3968,7 @@ void Monitor::handle_command(MonOpRequestRef op)
|
||||
|
||||
vector<string> tagsvec;
|
||||
cmd_getval(cmdmap, "tags", tagsvec);
|
||||
string tagstr = str_join(tagsvec, " ");
|
||||
string tagstr = ceph::str_join(tagsvec, " ");
|
||||
if (!tagstr.empty())
|
||||
tagstr = tagstr.substr(0, tagstr.find_last_of(' '));
|
||||
f->dump_string("tag", tagstr);
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
#include <algorithm>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <experimental/iterator>
|
||||
#include <list>
|
||||
#include <locale>
|
||||
#include <sstream>
|
||||
|
||||
@ -87,7 +88,7 @@
|
||||
#include "include/stringify.h"
|
||||
#include "include/util.h"
|
||||
#include "common/cmdparse.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/str_map.h"
|
||||
#include "include/scope_guard.h"
|
||||
#include "perfglue/heap_profiler.h"
|
||||
@ -6003,7 +6004,7 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
|
||||
for (auto n : { "network_numa_nodes", "objectstore_numa_nodes" }) {
|
||||
p = m.find(n);
|
||||
if (p != m.end()) {
|
||||
list<string> ls = get_str_list(p->second, ",");
|
||||
list<string> ls = ceph::split_str<std::list>(p->second, ",");
|
||||
f->open_array_section(n);
|
||||
for (auto node : ls) {
|
||||
f->dump_int("node", atoi(node.c_str()));
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
#include "PosixStack.h"
|
||||
|
||||
#include "include/buffer.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "common/errno.h"
|
||||
#include "common/strtol.h"
|
||||
#include "common/dout.h"
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/compat.h"
|
||||
#include "common/Cycles.h"
|
||||
#include "common/deleter.h"
|
||||
|
||||
@ -45,7 +45,7 @@ std::vector<uint32_t> CompressorRegistry::_parse_method_list(const std::string&
|
||||
{
|
||||
std::vector<uint32_t> methods;
|
||||
|
||||
for_each_substr(s, ";,= \t", [&] (auto method) {
|
||||
for_each_substr(s, [&] (auto method) {
|
||||
ldout(cct,20) << "adding algorithm method: " << method << dendl;
|
||||
|
||||
auto alg_type = Compressor::get_comp_alg_type(method);
|
||||
|
||||
@ -143,7 +143,7 @@
|
||||
#include "objclass/objclass.h"
|
||||
|
||||
#include "common/cmdparse.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/util.h"
|
||||
|
||||
#include "include/ceph_assert.h"
|
||||
@ -3213,7 +3213,7 @@ will start to track new ops received afterwards.";
|
||||
string arg;
|
||||
cmd_getval(cmdmap, "arg", arg);
|
||||
vector<string> argvec;
|
||||
get_str_vec(arg, argvec);
|
||||
ceph::split_str(arg, argvec);
|
||||
cpu_profiler_handle_command(argvec, ds);
|
||||
outbl.append(ds.str());
|
||||
}
|
||||
@ -11874,7 +11874,7 @@ int heap(CephContext& cct,
|
||||
}
|
||||
|
||||
std::vector<std::string> cmd_vec;
|
||||
get_str_vec(cmd, cmd_vec);
|
||||
ceph::split_str(cmd, cmd_vec);
|
||||
|
||||
string val;
|
||||
if (cmd_getval(cmdmap, "value", val)) {
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
#include "PGLog.h"
|
||||
#include "OSDMap.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "PGBackend.h"
|
||||
#include "PGPeeringEvent.h"
|
||||
#include "PeeringState.h"
|
||||
@ -132,7 +132,7 @@ class PGRecoveryStats {
|
||||
f->dump_stream("min_time") << i.min_time;
|
||||
f->dump_stream("max_time") << i.max_time;
|
||||
std::vector<std::string> states;
|
||||
get_str_vec(p->first, "/", states);
|
||||
ceph::split_str(p->first, "/", states);
|
||||
f->open_array_section("nested_states");
|
||||
for (std::vector<std::string>::iterator st = states.begin();
|
||||
st != states.end(); ++st) {
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
#include "common/config.h"
|
||||
#include "common/perf_counters.h"
|
||||
#include "common/scrub_types.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "common/errno.h"
|
||||
#include "common/EventTrace.h"
|
||||
#include "common/async/waiter.h"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
#include "../../../common/async/yield_context.h"
|
||||
#include "common/async/blocked_completion.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "rgw_perf_counters.h"
|
||||
|
||||
namespace rgw { namespace d4n {
|
||||
|
||||
@ -1808,7 +1808,7 @@ class DB {
|
||||
int from_oid(const std::string& oid, std::string& bucket, std::string& obj_name, std::string& obj_id,
|
||||
std::string& obj_instance,
|
||||
std::string& mp_str, uint64_t& partnum) {
|
||||
// TODO: use ceph::split() from common/split.h
|
||||
// TODO: use ceph::split() from include/str_lib.h
|
||||
// XXX: doesn't this break if obj_name has underscores in it?
|
||||
std::vector<std::string> result;
|
||||
boost::split(result, oid, boost::is_any_of("_"));
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
#include "global/global_init.h"
|
||||
|
||||
#include "include/utime.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include "rgw_user.h"
|
||||
#include "rgw_bucket.h"
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
#include "include/common_fwd.h"
|
||||
#include "include/utime.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include "rgw_sal_rados.h"
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#include "rgw_rest_bucket.h"
|
||||
#include "rgw_sal.h"
|
||||
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include "services/svc_sys_obj.h"
|
||||
#include "services/svc_zone.h"
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
#include "rgw_rest_user.h"
|
||||
#include "rgw_sal.h"
|
||||
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/ceph_assert.h"
|
||||
|
||||
#include "services/svc_zone.h"
|
||||
@ -267,7 +267,7 @@ void RGWOp_User_Create::execute(optional_yield y)
|
||||
|
||||
if (!placement_tags_str.empty()) {
|
||||
list<string> placement_tags_list;
|
||||
get_str_list(placement_tags_str, ",", placement_tags_list);
|
||||
ceph::split_str(placement_tags_str, ",", placement_tags_list);
|
||||
op_state.set_placement_tags(placement_tags_list);
|
||||
}
|
||||
|
||||
@ -425,7 +425,7 @@ void RGWOp_User_Modify::execute(optional_yield y)
|
||||
|
||||
if (!placement_tags_str.empty()) {
|
||||
list<string> placement_tags_list;
|
||||
get_str_list(placement_tags_str, ",", placement_tags_list);
|
||||
ceph::split_str(placement_tags_str, ",", placement_tags_list);
|
||||
op_state.set_placement_tags(placement_tags_list);
|
||||
}
|
||||
|
||||
|
||||
@ -305,7 +305,7 @@ int RadosUser::verify_mfa(const std::string& mfa_str, bool* verified,
|
||||
const DoutPrefixProvider* dpp, optional_yield y)
|
||||
{
|
||||
vector<string> params;
|
||||
get_str_vec(mfa_str, " ", params);
|
||||
ceph::split_str(mfa_str, " ", params);
|
||||
|
||||
if (params.size() != 2) {
|
||||
ldpp_dout(dpp, 5) << "NOTICE: invalid mfa string provided: " << mfa_str << dendl;
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
#include "services/svc_zone.h"
|
||||
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include <boost/asio/yield.hpp>
|
||||
|
||||
@ -43,7 +43,7 @@ class ItemList {
|
||||
void parse(const string& str) {
|
||||
list<string> l;
|
||||
|
||||
get_str_list(str, ",", l);
|
||||
ceph::split_str(str, ",", l);
|
||||
|
||||
for (auto& entry : l) {
|
||||
entry = rgw_trim_whitespace(entry);
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
#include "include/rados/librgw.h"
|
||||
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "common/ceph_argparse.h"
|
||||
#include "common/ceph_context.h"
|
||||
#include "common/dout.h"
|
||||
@ -58,7 +58,7 @@ int librgw_create(librgw_t* rgw, int argc, char **argv)
|
||||
// last non-0 argument will be split and consumed
|
||||
if (argc > 1) {
|
||||
const std::string spl_arg{argv[(--argc)]};
|
||||
get_str_vec(spl_arg, " \t", spl_args);
|
||||
ceph::split_str(spl_arg, " \t", spl_args);
|
||||
}
|
||||
auto args = argv_to_vec(argc, argv);
|
||||
// append split args, if any
|
||||
|
||||
@ -49,7 +49,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include "include/utime.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#ifdef WITH_RADOSGW_RADOS
|
||||
#include "radosgw-admin/orphan.h"
|
||||
@ -656,7 +656,7 @@ public:
|
||||
void add_commands(std::vector<Def>& cmds) {
|
||||
for (auto& cmd : cmds) {
|
||||
vector<string> words;
|
||||
get_str_vec(cmd.cmd, " ", words);
|
||||
ceph::split_str(cmd.cmd, " ", words);
|
||||
|
||||
auto node = &cmd_root;
|
||||
for (auto& word : words) {
|
||||
@ -3674,7 +3674,7 @@ static vector<rgw_zone_id> zone_ids_from_str(const string& val)
|
||||
{
|
||||
vector<rgw_zone_id> result;
|
||||
vector<string> v;
|
||||
get_str_vec(val, v);
|
||||
ceph::split_str(val, v);
|
||||
for (auto& z : v) {
|
||||
result.push_back(rgw_zone_id(z));
|
||||
}
|
||||
@ -4353,7 +4353,7 @@ int main(int argc, const char **argv)
|
||||
string cat_str = val;
|
||||
list<string> cat_list;
|
||||
list<string>::iterator iter;
|
||||
get_str_list(cat_str, cat_list);
|
||||
ceph::split_str(cat_str, cat_list);
|
||||
for (iter = cat_list.begin(); iter != cat_list.end(); ++iter) {
|
||||
categories[*iter] = true;
|
||||
}
|
||||
@ -4473,11 +4473,11 @@ int main(int argc, const char **argv)
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--storage-class", (char*)NULL)) {
|
||||
opt_storage_class = val;
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--tags", (char*)NULL)) {
|
||||
get_str_list(val, ",", tags);
|
||||
ceph::split_str(val, ",", tags);
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--tags-add", (char*)NULL)) {
|
||||
get_str_list(val, ",", tags_add);
|
||||
ceph::split_str(val, ",", tags_add);
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--tags-rm", (char*)NULL)) {
|
||||
get_str_list(val, ",", tags_rm);
|
||||
ceph::split_str(val, ",", tags_rm);
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--api-name", (char*)NULL)) {
|
||||
api_name = val;
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--zone-id", (char*)NULL)) {
|
||||
@ -4487,11 +4487,11 @@ int main(int argc, const char **argv)
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--zone-new-name", (char*)NULL)) {
|
||||
zone_new_name = val;
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--endpoints", (char*)NULL)) {
|
||||
get_str_list(val, endpoints);
|
||||
ceph::split_str(val, endpoints);
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--sync-from", (char*)NULL)) {
|
||||
get_str_list(val, sync_from);
|
||||
ceph::split_str(val, sync_from);
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--sync-from-rm", (char*)NULL)) {
|
||||
get_str_list(val, sync_from_rm);
|
||||
ceph::split_str(val, sync_from_rm);
|
||||
} else if (ceph_argparse_binary_flag(args, i, &tmp_int, NULL, "--sync-from-all", (char*)NULL)) {
|
||||
sync_from_all = (bool)tmp_int;
|
||||
sync_from_all_specified = true;
|
||||
@ -4584,19 +4584,19 @@ int main(int argc, const char **argv)
|
||||
opt_flow_type = val;
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--zones", "--zone-names", (char*)NULL)) {
|
||||
vector<string> v;
|
||||
get_str_vec(val, v);
|
||||
ceph::split_str(val, v);
|
||||
opt_zone_names = std::move(v);
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--zone-ids", (char*)NULL)) {
|
||||
opt_zone_ids = zone_ids_from_str(val);
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--source-zones", "--source-zone-names", (char*)NULL)) {
|
||||
vector<string> v;
|
||||
get_str_vec(val, v);
|
||||
ceph::split_str(val, v);
|
||||
opt_source_zone_names = std::move(v);
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--source-zone-ids", (char*)NULL)) {
|
||||
opt_source_zone_ids = zone_ids_from_str(val);
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--dest-zones", "--dest-zone-names", (char*)NULL)) {
|
||||
vector<string> v;
|
||||
get_str_vec(val, v);
|
||||
ceph::split_str(val, v);
|
||||
opt_dest_zone_names = std::move(v);
|
||||
} else if (ceph_argparse_witharg(args, i, &val, "--dest-zone-ids", (char*)NULL)) {
|
||||
opt_dest_zone_ids = zone_ids_from_str(val);
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#include <map>
|
||||
|
||||
#include "include/types.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include "rgw_acl_s3.h"
|
||||
#include "driver/rados/rgw_user.h"
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
|
||||
#include "common/ceph_json.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "rgw_common.h"
|
||||
#include "driver/rados/rgw_user.h"
|
||||
#include "rgw_acl_swift.h"
|
||||
|
||||
@ -22,9 +22,8 @@
|
||||
#include "common/Timer.h"
|
||||
#include "common/TracepointProvider.h"
|
||||
#include "common/numa.h"
|
||||
#include "common/split.h"
|
||||
#include "include/compat.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/stringify.h"
|
||||
#include "rgw_kms_cache.h"
|
||||
#include "rgw_main.h"
|
||||
@ -105,7 +104,7 @@ void rgw::AppMain::init_frontends1(bool nfs)
|
||||
std::vector<std::string> frontends;
|
||||
std::string rgw_frontends_str = g_conf().get_val<string>(fe_key);
|
||||
g_conf().early_expand_meta(rgw_frontends_str, &cerr);
|
||||
get_str_vec(rgw_frontends_str, ",", frontends);
|
||||
ceph::split_str(rgw_frontends_str, ",", frontends);
|
||||
|
||||
/* default frontends */
|
||||
if (nfs) {
|
||||
@ -409,7 +408,7 @@ int rgw::AppMain::init_frontends2(RGWLib* rgwlib)
|
||||
vector<string> frontends_def;
|
||||
std::string frontend_defs_str =
|
||||
g_conf().get_val<string>("rgw_frontend_defaults");
|
||||
get_str_vec(frontend_defs_str, ",", frontends_def);
|
||||
ceph::split_str(frontend_defs_str, ",", frontends_def);
|
||||
|
||||
service_map_meta["pid"] = stringify(getpid());
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
#include <boost/asio/ssl.hpp>
|
||||
#endif
|
||||
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include "services/svc_config_key.h"
|
||||
#include "services/svc_zone.h"
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
#include "rgw_log.h"
|
||||
|
||||
#include "include/function2.hpp"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#define dout_context g_ceph_context
|
||||
#define dout_subsys ceph_subsys_rgw
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
#include "common/errno.h"
|
||||
#include "common/ceph_json.h"
|
||||
#include "include/types.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include "rgw_common.h"
|
||||
#include "rgw_keystone.h"
|
||||
@ -248,9 +248,9 @@ TokenEngine::authenticate(const DoutPrefixProvider* dpp,
|
||||
* also thread-safe. */
|
||||
static const struct RolesCacher {
|
||||
explicit RolesCacher(CephContext* const cct) {
|
||||
get_str_vec(cct->_conf->rgw_keystone_accepted_roles, plain);
|
||||
get_str_vec(cct->_conf->rgw_keystone_accepted_admin_roles, admin);
|
||||
get_str_vec(cct->_conf->rgw_keystone_accepted_reader_roles, reader);
|
||||
ceph::split_str(cct->_conf->rgw_keystone_accepted_roles, plain);
|
||||
ceph::split_str(cct->_conf->rgw_keystone_accepted_admin_roles, admin);
|
||||
ceph::split_str(cct->_conf->rgw_keystone_accepted_reader_roles, reader);
|
||||
|
||||
/* Let's suppose that having an admin role implies also a regular one. */
|
||||
plain.insert(std::end(plain), std::begin(admin), std::end(admin));
|
||||
@ -263,7 +263,7 @@ TokenEngine::authenticate(const DoutPrefixProvider* dpp,
|
||||
|
||||
static const struct ServiceTokenRolesCacher {
|
||||
explicit ServiceTokenRolesCacher(CephContext* const cct) {
|
||||
get_str_vec(cct->_conf->rgw_keystone_service_token_accepted_roles, plain);
|
||||
ceph::split_str(cct->_conf->rgw_keystone_service_token_accepted_roles, plain);
|
||||
}
|
||||
|
||||
std::vector<std::string> plain;
|
||||
@ -710,8 +710,8 @@ rgw::auth::Engine::result_t EC2Engine::authenticate(
|
||||
* also thread-safe. */
|
||||
static const struct RolesCacher {
|
||||
explicit RolesCacher(CephContext* const cct) {
|
||||
get_str_vec(cct->_conf->rgw_keystone_accepted_roles, plain);
|
||||
get_str_vec(cct->_conf->rgw_keystone_accepted_admin_roles, admin);
|
||||
ceph::split_str(cct->_conf->rgw_keystone_accepted_roles, plain);
|
||||
ceph::split_str(cct->_conf->rgw_keystone_accepted_admin_roles, admin);
|
||||
|
||||
/* Let's suppose that having an admin role implies also a regular one. */
|
||||
plain.insert(std::end(plain), std::begin(admin), std::end(admin));
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
#include "common/armor.h"
|
||||
#include "common/utf8.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/timegm.h"
|
||||
#include "rgw_rest_s3.h"
|
||||
#include "rgw_auth_s3.h"
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
#include <utility>
|
||||
#include <tuple>
|
||||
#include <cstring>
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "rgw_cksum.h"
|
||||
#include "rgw_cksum_digest.h"
|
||||
#include "rgw_common.h"
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
#include "common/Clock.h"
|
||||
#include "common/convenience.h"
|
||||
#include "common/strtol.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "include/timegm.h"
|
||||
#include "rgw_crypt_sanitize.h"
|
||||
#include "rgw_bucket_sync.h"
|
||||
@ -1951,7 +1951,7 @@ static int rgw_parse_list_of_flags(struct rgw_name_to_flag *mapping,
|
||||
const string& str, uint32_t *perm)
|
||||
{
|
||||
list<string> strs;
|
||||
get_str_list(str, strs);
|
||||
ceph::split_str(str, strs);
|
||||
list<string>::iterator iter;
|
||||
uint32_t v = 0;
|
||||
for (iter = strs.begin(); iter != strs.end(); ++iter) {
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
#include "include/types.h"
|
||||
#include "common/debug.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "common/ceph_json.h"
|
||||
#include "common/Formatter.h"
|
||||
|
||||
@ -99,7 +99,7 @@ int RGWCORSRule::create_rule(const char *allow_origins, const char *allow_header
|
||||
nr_invalid_names++;
|
||||
}
|
||||
};
|
||||
for_each_substr(allow_origins, ";,= \t", add_host);
|
||||
for_each_substr(allow_origins, add_host);
|
||||
if (o.empty() || nr_invalid_names > 0) {
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -113,17 +113,16 @@ int RGWCORSRule::create_rule(const char *allow_origins, const char *allow_header
|
||||
nr_invalid_headers++;
|
||||
}
|
||||
};
|
||||
for_each_substr(allow_headers, ";,= \t", add_header);
|
||||
for_each_substr(allow_headers, add_header);
|
||||
if (h.empty() || nr_invalid_headers > 0) {
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
if (expose_headers) {
|
||||
for_each_substr(expose_headers, ";,= \t",
|
||||
[&e] (auto expose_header) {
|
||||
e.emplace_back(std::string(expose_header));
|
||||
});
|
||||
for_each_substr(expose_headers, [&e] (auto expose_header) {
|
||||
e.emplace_back(std::string(expose_header));
|
||||
});
|
||||
}
|
||||
if (max_age) {
|
||||
char *end = NULL;
|
||||
@ -175,7 +174,7 @@ static bool is_string_in_set(set<string>& s, string h) {
|
||||
list<string> ssplit;
|
||||
unsigned flen = 0;
|
||||
|
||||
get_str_list((*it), "* \t", ssplit);
|
||||
ceph::split_str((*it), "* \t", ssplit);
|
||||
if (off != 0) {
|
||||
if (ssplit.empty())
|
||||
continue;
|
||||
@ -261,7 +260,7 @@ bool RGWCORSRule::matches_preflight_headers(const char *req_hdrs)
|
||||
return true;
|
||||
}
|
||||
vector<string> hdrs;
|
||||
get_str_vec(req_hdrs, hdrs);
|
||||
ceph::split_str(req_hdrs, hdrs);
|
||||
for (const auto& hdr : hdrs) {
|
||||
if (!is_header_allowed(hdr.c_str(), hdr.length())) {
|
||||
dout(5) << "Header " << hdr << " is not registered in this rule" << dendl;
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
#include <string>
|
||||
#include <include/types.h>
|
||||
#include "include/encoding.h" // for WRITE_CLASS_ENCODER()
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#define RGW_CORS_GET 0x1
|
||||
#define RGW_CORS_PUT 0x2
|
||||
@ -173,7 +173,7 @@ static inline uint8_t get_multi_cors_method_flags(const char *req_meth) {
|
||||
else if (method == "HEAD") flags |= RGW_CORS_HEAD;
|
||||
else if (method == "COPY") flags |= RGW_CORS_COPY;
|
||||
};
|
||||
ceph::for_each_substr(allowed_methods, ";,= \t", apply_flag);
|
||||
ceph::for_each_substr(allowed_methods, apply_flag);
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <include/types.h>
|
||||
#include <include/str_list.h>
|
||||
#include <include/str_lib.h>
|
||||
|
||||
#include "rgw_cors.h"
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
#include <signal.h>
|
||||
|
||||
#include "rgw_frontend.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include "include/ceph_assert.h"
|
||||
|
||||
@ -17,7 +17,7 @@ using namespace std;
|
||||
int RGWFrontendConfig::parse_config(const string& config,
|
||||
std::multimap<string, string>& config_map)
|
||||
{
|
||||
for (auto& entry : get_str_vec(config, " ")) {
|
||||
for (auto& entry : ceph::split_str(config, " ")) {
|
||||
string key;
|
||||
string val;
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
#include "common/ceph_json.h"
|
||||
#include "include/timegm.h"
|
||||
#include "include/types.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include "rgw_common.h"
|
||||
#include "rgw_keystone.h"
|
||||
|
||||
@ -1006,7 +1006,7 @@ std::string config_to_engine_and_parms(CephContext *cct,
|
||||
std::vector<std::string> secret_engine_v;
|
||||
std::string secret_engine;
|
||||
|
||||
get_str_vec(secret_engine_str, " ", secret_engine_v);
|
||||
ceph::split_str(secret_engine_str, " ", secret_engine_v);
|
||||
|
||||
cct->_conf.early_expand_meta(secret_engine_str, &oss);
|
||||
auto meta_errors {oss.str()};
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#include "common/async/spawn_throttle.h"
|
||||
#include "common/Formatter.h"
|
||||
#include "common/containers.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include <common/errno.h>
|
||||
#include "include/random.h"
|
||||
#include "cls/lock/cls_lock_client.h"
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include <iostream>
|
||||
#include <include/types.h>
|
||||
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "rgw_lc.h"
|
||||
#include "rgw_xml.h"
|
||||
#include "rgw_tag_s3.h"
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
#include "include/rados/librgw.h"
|
||||
#include "rgw_acl.h"
|
||||
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "global/signal_handler.h"
|
||||
#include "common/Timer.h"
|
||||
#include "common/WorkQueue.h"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// vim: ts=8 sw=2 sts=2 expandtab
|
||||
|
||||
#include "rgw_notify_event_type.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
namespace rgw::notify {
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#include "global/global_init.h"
|
||||
|
||||
#include "include/utime.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include "driver/rados/rgw_user.h"
|
||||
#include "rgw_bucket.h"
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
#include "rgw_cksum.h"
|
||||
#include "rgw_cksum_digest.h"
|
||||
#include "rgw_common.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "rgw_tracer.h"
|
||||
|
||||
#include "rgw_zone.h"
|
||||
@ -1921,7 +1921,7 @@ int RGWOp::read_global_cors()
|
||||
static void get_cors_response_headers(const DoutPrefixProvider *dpp, RGWCORSRule *rule, const char *req_hdrs, string& hdrs, string& exp_hdrs, unsigned *max_age) {
|
||||
if (req_hdrs) {
|
||||
list<string> hl;
|
||||
get_str_list(req_hdrs, hl);
|
||||
ceph::split_str(req_hdrs, hl);
|
||||
for(list<string>::iterator it = hl.begin(); it != hl.end(); ++it) {
|
||||
if (!rule->is_header_allowed((*it).c_str(), (*it).length())) {
|
||||
ldpp_dout(dpp, 5) << "Header " << (*it) << " is not registered in this rule" << dendl;
|
||||
|
||||
@ -10,9 +10,8 @@
|
||||
#include "ceph_ver.h"
|
||||
#include "common/HTMLFormatter.h"
|
||||
#include "common/XMLFormatter.h"
|
||||
#include "common/split.h"
|
||||
#include "common/utf8.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "rgw_common.h"
|
||||
#include "rgw_zone.h"
|
||||
#include "rgw_auth_s3.h"
|
||||
@ -148,7 +147,7 @@ void rgw_rest_init(CephContext *cct, const rgw::sal::ZoneGroup& zone_group)
|
||||
}
|
||||
|
||||
list<string> extended_http_attrs;
|
||||
get_str_list(cct->_conf->rgw_extended_http_attrs, extended_http_attrs);
|
||||
ceph::split_str(cct->_conf->rgw_extended_http_attrs, extended_http_attrs);
|
||||
|
||||
list<string>::iterator iter;
|
||||
for (iter = extended_http_attrs.begin(); iter != extended_http_attrs.end(); ++iter) {
|
||||
@ -170,7 +169,7 @@ void rgw_rest_init(CephContext *cct, const rgw::sal::ZoneGroup& zone_group)
|
||||
|
||||
std::list<std::string> rgw_dns_names;
|
||||
std::string rgw_dns_names_str = cct->_conf->rgw_dns_name;
|
||||
get_str_list(rgw_dns_names_str, ", ", rgw_dns_names);
|
||||
ceph::split_str(rgw_dns_names_str, ", ", rgw_dns_names);
|
||||
hostnames_set.insert(rgw_dns_names.begin(), rgw_dns_names.end());
|
||||
|
||||
std::list<std::string> names;
|
||||
@ -1984,7 +1983,7 @@ RGWRESTMgr* RGWRESTMgr::get_resource_mgr(req_state* const s,
|
||||
|
||||
void RGWREST::register_x_headers(const string& s_headers)
|
||||
{
|
||||
std::vector<std::string> hdrs = get_str_vec(s_headers);
|
||||
std::vector<std::string> hdrs = ceph::split_str(s_headers);
|
||||
for (auto& hdr : hdrs) {
|
||||
boost::algorithm::to_upper(hdr); // XXX
|
||||
(void) x_headers.insert(hdr);
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include "rgw_http_errors.h"
|
||||
|
||||
#include "common/strtol.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "rgw_crypt_sanitize.h"
|
||||
|
||||
#define dout_context g_ceph_context
|
||||
@ -299,7 +299,7 @@ static bool identify_scope(const DoutPrefixProvider *dpp,
|
||||
|
||||
vector<string> vec;
|
||||
|
||||
get_str_vec(host, ".", vec);
|
||||
ceph::split_str(host, ".", vec);
|
||||
|
||||
string ser = service;
|
||||
if (service.empty()) {
|
||||
@ -752,7 +752,7 @@ static int parse_rgwx_mtime(const DoutPrefixProvider *dpp, CephContext *cct, con
|
||||
string err;
|
||||
vector<string> vec;
|
||||
|
||||
get_str_vec(s, ".", vec);
|
||||
ceph::split_str(s, ".", vec);
|
||||
|
||||
if (vec.empty()) {
|
||||
return -EINVAL;
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
#include "common/ceph_crypto.h"
|
||||
#include "common/dout.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "common/Formatter.h"
|
||||
#include "common/utf8.h"
|
||||
#include "common/ceph_json.h"
|
||||
@ -5125,11 +5125,11 @@ int RGWConfigBucketMetaSearch_ObjStore_S3::get_params(optional_yield y)
|
||||
}
|
||||
|
||||
list<string> expressions;
|
||||
get_str_list(iter->second, ",", expressions);
|
||||
ceph::split_str(iter->second, ",", expressions);
|
||||
|
||||
for (auto& expression : expressions) {
|
||||
vector<string> args;
|
||||
get_str_vec(expression, ";", args);
|
||||
ceph::split_str(expression, ";", args);
|
||||
|
||||
if (args.empty()) {
|
||||
s->err.message = "invalid empty expression";
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include "rgw_rest_usage.h"
|
||||
#include "rgw_sal.h"
|
||||
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#define dout_subsys ceph_subsys_rgw
|
||||
|
||||
@ -60,7 +60,7 @@ void RGWOp_Usage_Get::execute(optional_yield y) {
|
||||
if (!cat_str.empty()) {
|
||||
list<string> cat_list;
|
||||
list<string>::iterator iter;
|
||||
get_str_list(cat_str, cat_list);
|
||||
ceph::split_str(cat_str, cat_list);
|
||||
for (iter = cat_list.begin(); iter != cat_list.end(); ++iter) {
|
||||
categories[*iter] = true;
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
#include "common/Clock.h" // for ceph_clock_now()
|
||||
#include "common/Formatter.h"
|
||||
#include "common/containers.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include <common/errno.h>
|
||||
#include "include/random.h"
|
||||
#include "cls/lock/cls_lock_client.h"
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
#include <string_view>
|
||||
|
||||
#include "common/ceph_crypto.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "common/Formatter.h"
|
||||
#include "common/utf8.h"
|
||||
#include "common/ceph_json.h"
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#include "rgw_client_io.h"
|
||||
#include "rgw_http_client.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#define dout_context g_ceph_context
|
||||
#define dout_subsys ceph_subsys_rgw
|
||||
@ -487,7 +487,7 @@ ExternalTokenEngine::authenticate(const DoutPrefixProvider* dpp,
|
||||
std::string swift_user;
|
||||
try {
|
||||
std::vector<std::string> swift_groups;
|
||||
get_str_vec(validator.get_header_value("X-Auth-Groups"),
|
||||
ceph::split_str(validator.get_header_value("X-Auth-Groups"),
|
||||
",", swift_groups);
|
||||
|
||||
if (0 == swift_groups.size()) {
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include "common/debug.h"
|
||||
#include "global/global_init.h"
|
||||
#include "include/ceph_assert.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include "rgw_token.h"
|
||||
#include "rgw_b64.h"
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
#include "common/errno.h"
|
||||
#include "common/safe_io.h" // for safe_read()
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
|
||||
#include "driver/rados/rgw_tools.h"
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
#include "rgw_torrent.h"
|
||||
#include <ctime>
|
||||
#include <fmt/format.h>
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "rgw_sal.h"
|
||||
|
||||
#define ANNOUNCE "announce"
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#include "include/intarith.h"
|
||||
#include "include/stringify.h"
|
||||
#include "include/random.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "common/perf_counters.h"
|
||||
#include "common/TracepointProvider.h"
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
#include "common/ceph_json.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/dout.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "common/strtol.h" // for strict_iecstrtoll()
|
||||
#include "common/ceph_json.h"
|
||||
#include "common/Formatter.h"
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
#include "common/io_exerciser/IoOp.h"
|
||||
#include "common/io_exerciser/IoSequence.h"
|
||||
#include "common/io_exerciser/Model.h"
|
||||
#include "common/split.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "erasure-code/ErasureCodePlugin.h"
|
||||
#include "global/global_context.h"
|
||||
#include "global/global_init.h"
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include "common/ceph_json.h"
|
||||
#include "common/code_environment.h"
|
||||
#include "common/armor.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "test_rgw_admin_helper.h"
|
||||
|
||||
using namespace std;
|
||||
@ -307,7 +307,7 @@ namespace admin_helper
|
||||
{
|
||||
/* child */
|
||||
list<string> l;
|
||||
get_str_list(cmd, " \t", l);
|
||||
ceph::split_str(cmd, " \t", l);
|
||||
// One extra for argv[0] and one for the NULL.
|
||||
std::vector<char*> argv(l.size() + 2);
|
||||
unsigned loop = 1;
|
||||
|
||||
@ -27,7 +27,7 @@ extern "C"{
|
||||
#include <curl/curl.h>
|
||||
}
|
||||
#include "common/ceph_crypto.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "common/ceph_json.h"
|
||||
#include "common/code_environment.h"
|
||||
#include "common/ceph_argparse.h"
|
||||
@ -308,7 +308,7 @@ int run_rgw_admin(string& cmd, string& resp) {
|
||||
if (pid == 0) {
|
||||
/* child */
|
||||
list<string> l;
|
||||
get_str_list(cmd, " \t", l);
|
||||
ceph::split_str(cmd, " \t", l);
|
||||
// One extra for argv[0] and one for the NULL.
|
||||
std::vector<char*> argv(l.size() + 2);
|
||||
unsigned loop = 1;
|
||||
|
||||
@ -640,7 +640,7 @@ static int update_mgrmap(MonitorDBStore& st)
|
||||
// mgr expects epoch > 1
|
||||
map.epoch++;
|
||||
auto initial_modules =
|
||||
get_str_vec(g_ceph_context->_conf.get_val<string>("mgr_initial_modules"));
|
||||
ceph::split_str(g_ceph_context->_conf.get_val<string>("mgr_initial_modules"));
|
||||
copy(begin(initial_modules),
|
||||
end(initial_modules),
|
||||
inserter(map.modules, end(map.modules)));
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
#include "global/global_context.h"
|
||||
#include "global/global_init.h"
|
||||
#include "include/str_list.h"
|
||||
#include "include/str_lib.h"
|
||||
#include "mon/MonMap.h"
|
||||
#include "mon/mon_types.h" // for ceph::features::mon::*
|
||||
|
||||
@ -393,7 +393,7 @@ int main(int argc, const char **argv)
|
||||
if (filter) {
|
||||
// apply initial members
|
||||
list<string> initial_members;
|
||||
get_str_list(g_conf()->mon_initial_members, initial_members);
|
||||
ceph::split_str(g_conf()->mon_initial_members, initial_members);
|
||||
if (!initial_members.empty()) {
|
||||
cout << "initial_members " << initial_members << ", filtering seed monmap" << std::endl;
|
||||
set<entity_addrvec_t> removed;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user