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

Method __init__

src/python/cli_new/lib/cli/tests/base.py:165–189  ·  view source on GitHub ↗
(self, flags=None)

Source from the content-addressed store, hash-verified

163 count = 0
164
165 def __init__(self, flags=None):
166 super(Master, self).__init__()
167
168 if Master.count > 0:
169 raise CLIException("Creating more than one master"
170 " is currently not possible")
171
172 if flags is None:
173 flags = {}
174
175 if "ip" not in flags:
176 flags["ip"] = TEST_MASTER_IP
177 if "port" not in flags:
178 flags["port"] = TEST_MASTER_PORT
179 if "work_dir" not in flags:
180 flags["work_dir"] = tempfile.mkdtemp()
181
182 self.flags = flags
183 self.name = "master"
184 self.addr = "{ip}:{port}".format(ip=flags["ip"], port=flags["port"])
185 self.executable = os.path.join(
186 CLITestCase.MESOS_BUILD_DIR,
187 "bin",
188 "mesos-{name}.sh".format(name=self.name))
189 self.shell = True
190
191 def __del__(self):
192 super(Master, self).__del__()

Callers

nothing calls this directly

Calls 4

CLIExceptionClass · 0.90
mkdtempMethod · 0.80
joinMethod · 0.65
__init__Method · 0.45

Tested by

no test coverage detected