Recover each of the frameworks.
| 189 | |
| 190 | // Recover each of the frameworks. |
| 191 | foreach (const string& path, frameworks.get()) { |
| 192 | FrameworkID frameworkId; |
| 193 | frameworkId.set_value(Path(path).basename()); |
| 194 | |
| 195 | Try<FrameworkState> framework = |
| 196 | FrameworkState::recover(rootDir, slaveId, frameworkId, strict, rebooted); |
| 197 | |
| 198 | if (framework.isError()) { |
| 199 | return Error("Failed to recover framework " + frameworkId.value() + |
| 200 | ": " + framework.error()); |
| 201 | } |
| 202 | |
| 203 | state.frameworks[frameworkId] = framework.get(); |
| 204 | state.errors += framework->errors; |
| 205 | } |
| 206 | |
| 207 | // Recover any drain state. |
| 208 | const string drainConfigPath = paths::getDrainConfigPath(rootDir, slaveId); |