Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs: Fix the
intro/tutorial.md
notebook
The notebook creates and loads a temporary profile using the `SqliteTempBackend` backend. This works fine as long as the profile is only used in the current interpreter and no code is hit that checks the profile is present in the `Config`. The reason is that although the profile is loaded, it is created on the fly and not actually added to the `Config` that is loaded in memory, nor is it written to the `config.json` file on disk. As soon as any code is called that will check the existence of the temporary profile, through the config, it will fail. A good example is when `%verdi process list` is called. At the end of the command, the status of the daemon is checked, for which a `DaemonClient` instance is constructed, which calls `config.get_option('daemon.timeout', profile)`. This call will validate the provided profile to check that it actually exists, i.e., is known within the config, which is not the case, and so a `ProfileConfigurationError` is raised. The solution is to update the notebook to actually add the created temporary profile to the config loaded in memory. Note that this could have the undesirable consequence that if the config state is written to disk, the temporary profile can be added to `config.json`. This will not be automatically cleaned up. Since here it concerns a demo notebook that will just be run on temporary resources anyway, it not being cleaned up is not a problem. Ideally there would be a utility for notebooks that creates a temporary profile and actually adds it to the config, and cleans it up at the end of the notebook. But it will be difficult to guarantee the cleanup in all cases.
- Loading branch information