MCPcopy Create free account
hub / github.com/apache/mesos / verify

Function verify

src/linux/cgroups.cpp:409–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407
408
409Try<Nothing> verify(
410 const string& hierarchy,
411 const string& cgroup,
412 const string& control)
413{
414 Try<bool> mounted = cgroups::mounted(hierarchy);
415 if (mounted.isError()) {
416 return Error(
417 "Failed to determine if the hierarchy at '" + hierarchy +
418 "' is mounted: " + mounted.error());
419 } else if (!mounted.get()) {
420 return Error("'" + hierarchy + "' is not a valid hierarchy");
421 }
422
423 if (cgroup != "") {
424 if (!os::exists(path::join(hierarchy, cgroup))) {
425 return Error("'" + cgroup + "' is not a valid cgroup");
426 }
427 }
428
429 if (control != "") {
430 if (!os::exists(path::join(hierarchy, cgroup, control))) {
431 return Error(
432 "'" + control + "' is not a valid control (is subsystem attached?)");
433 }
434 }
435
436 return Nothing();
437}
438
439
440bool enabled()

Callers 1

initializeFunction · 0.70

Calls 8

mountedFunction · 0.85
NothingClass · 0.85
existsFunction · 0.70
errorMethod · 0.65
ErrorFunction · 0.50
joinFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected