This works around the fact that the old asok 'session evict' took a bare
id and the tell version took a filter.
Signed-off-by: Sage Weil <sage@redhat.com>
auto eq = s.find("=");
if (eq == std::string::npos || eq == s.size()) {
- *ss << "Invalid filter '" << s << "'";
- return -EINVAL;
+ // allow this to be a bare id for compatibility with pre-octopus asok
+ // 'session evict'.
+ std::string err;
+ id = strict_strtoll(s.c_str(), 10, &err);
+ if (!err.empty()) {
+ *ss << "Invalid filter '" << s << "'";
+ return -EINVAL;
+ }
+ return 0;
}
// Keys that start with this are to be taken as referring