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)
| 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 | """ |
no test coverage detected