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

Method execute

src/slave/containerizer/mesos/mount.cpp:53–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52
53int MesosContainerizerMount::execute()
54{
55 if (flags.help) {
56 cerr << flags.usage();
57 return EXIT_SUCCESS;
58 }
59
60#ifdef __linux__
61 if (flags.operation.isNone()) {
62 cerr << "Flag --operation is not specified" << endl;
63 return 1;
64 }
65
66 if (flags.operation.get() == MAKE_RSLAVE) {
67 if (flags.path.isNone()) {
68 cerr << "Flag --path is required for " << MAKE_RSLAVE << endl;
69 return 1;
70 }
71
72 Try<Nothing> mount = mesos::internal::fs::mount(
73 None(),
74 flags.path.get(),
75 None(),
76 MS_SLAVE | MS_REC,
77 nullptr);
78
79 if (mount.isError()) {
80 cerr << "Failed to mark rslave with path '" << flags.path.get() << "': "
81 << mount.error();
82 return 1;
83 }
84 } else {
85 cerr << "Unsupported mount operation '" << flags.operation.get() << "'";
86 return 1;
87 }
88
89 return 0;
90#else
91 cerr << "Mount is only supported on Linux";
92
93 return 1;
94#endif // __linux__
95}
96
97} // namespace slave {
98} // namespace internal {

Callers 1

removeMethod · 0.45

Calls 7

NoneClass · 0.85
errorMethod · 0.65
mountFunction · 0.50
usageMethod · 0.45
isNoneMethod · 0.45
getMethod · 0.45
isErrorMethod · 0.45

Tested by

no test coverage detected