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

Method ps

src/docker/docker.cpp:1599–1637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1597
1598
1599Future<vector<Docker::Container>> Docker::ps(
1600 bool all,
1601 const Option<string>& prefix) const
1602{
1603 vector<string> argv;
1604 argv.push_back(path);
1605 argv.push_back("-H");
1606 argv.push_back(socket);
1607 argv.push_back("ps");
1608
1609 if (all) {
1610 argv.push_back("-a");
1611 }
1612
1613 const string cmd = strings::join(" ", argv);
1614
1615 VLOG(1) << "Running " << cmd;
1616
1617 Try<Subprocess> s = subprocess(
1618 cmd,
1619 Subprocess::PATH(os::DEV_NULL),
1620 Subprocess::PIPE(),
1621 Subprocess::PIPE(),
1622 None(),
1623 None(),
1624 createParentHooks());
1625
1626 if (s.isError()) {
1627 return Failure("Failed to create subprocess '" + cmd + "': " + s.error());
1628 }
1629
1630 // Start reading from stdout so writing to the pipe won't block
1631 // to handle cases where the output is larger than the pipe
1632 // capacity.
1633 const Future<string>& output = io::read(s->out().get());
1634
1635 return s->status()
1636 .then(lambda::bind(&Docker::_ps, *this, cmd, s.get(), prefix, output));
1637}
1638
1639
1640Future<vector<Docker::Container>> Docker::_ps(

Callers 7

TearDownMethod · 0.80
TEST_FFunction · 0.80
TearDownMethod · 0.80
TEST_FFunction · 0.80
TearDownMethod · 0.80
recoverMethod · 0.80

Calls 12

NoneClass · 0.85
FailureClass · 0.85
outMethod · 0.80
errorMethod · 0.65
joinFunction · 0.50
subprocessFunction · 0.50
readFunction · 0.50
bindFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45
thenMethod · 0.45
statusMethod · 0.45

Tested by 6

TearDownMethod · 0.64
TEST_FFunction · 0.64
TearDownMethod · 0.64
TEST_FFunction · 0.64
TearDownMethod · 0.64