MCPcopy Create free account
hub / github.com/saltstack/salt / prepare

Method prepare

salt/cli/daemons.py:174–209  ·  view source on GitHub ↗

Run the preparation sequence required to start a salt master server. If sub-classed, don't **ever** forget to run: super(YourSubClass, self).prepare()

(self)

Source from the content-addressed store, hash-verified

172 )
173
174 def prepare(self):
175 """
176 Run the preparation sequence required to start a salt master server.
177
178 If sub-classed, don't **ever** forget to run:
179
180 super(YourSubClass, self).prepare()
181 """
182 super().prepare()
183 _ostruststore.apply_if_enabled(self.config)
184
185 try:
186 self.verify_environment()
187 except OSError as error:
188 self.environment_failure(error)
189
190 self.action_log_info("Setting up")
191
192 # TODO: AIO core is separate from transport
193 if not verify_socket(
194 self.config["interface"],
195 self.config["publish_port"],
196 self.config["ret_port"],
197 ):
198 self.shutdown(4, "The ports are not available to bind")
199 self.config["interface"] = ip_bracket(self.config["interface"])
200 migrations.migrate_paths(self.config)
201
202 # Late import so logging works correctly
203 import salt.master
204
205 self.master = salt.master.Master(self.config)
206
207 self.daemonize_if_required()
208 self.set_pidfile()
209 salt.utils.process.notify_systemd()
210
211 def start(self):
212 """

Callers 3

prepareMethod · 0.45
prepareMethod · 0.45
prepareMethod · 0.45

Calls 8

verify_environmentMethod · 0.95
shutdownMethod · 0.95
verify_socketFunction · 0.90
ip_bracketFunction · 0.90
environment_failureMethod · 0.80
action_log_infoMethod · 0.80
daemonize_if_requiredMethod · 0.80
set_pidfileMethod · 0.80

Tested by

no test coverage detected