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

Function machine

src/master/maintenance.cpp:293–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291
292
293Try<Nothing> machine(const MachineID& id)
294{
295 // Verify that the machine has at least one non-empty field value.
296 if (id.hostname().empty() && id.ip().empty()) {
297 return Error("Both 'hostname' and 'ip' for a machine are empty");
298 }
299
300 // Validate the IP field.
301 if (!id.ip().empty()) {
302 Try<net::IP> ip = net::IP::parse(id.ip(), AF_INET);
303 if (ip.isError()) {
304 return Error(ip.error());
305 }
306 }
307
308 return Nothing();
309}
310
311} // namespace validation {
312} // namespace maintenance {

Callers 1

foreachFunction · 0.85

Calls 6

NothingClass · 0.85
errorMethod · 0.65
ErrorFunction · 0.50
parseFunction · 0.50
emptyMethod · 0.45
isErrorMethod · 0.45

Tested by

no test coverage detected