Skip to content
Snippets Groups Projects

Resolve "faq entry to set datastore configuration in resconfig"

Files
2
+ 4
6
@@ -32,13 +32,11 @@ Then run `texts` again. Then use the [variable update](scl.md#dealing-with-failu
**A**: This can be done using the [vre-middleware's](https://vre-middleware.readthedocs.io/en/latest/resconfig.html) Python API. For example, within an iPython command line session:
```python
from os import path
from virtmat.middleware.resconfig import get_resconfig_loc, ResConfig, WorkerConfig
cfg = ResConfig.from_file(get_resconfig_loc())
from virtmat.middleware.resconfig import get_resconfig_loc, get_default_resconfig
cfg = get_default_resconfig()
wcfg = cfg.workers[0]
wcfg.envvars = {'DATASTORE_CONFIG': '/alternative/path_to/my_project/datastore_config.yaml'}
wcfg.default_envvars = ['DATASTORE_CONFIG']
wcfg.envvars.update({'DATASTORE_CONFIG': '/alternative/path_to/my_project/datastore_config.yaml'})
wcfg.default_envvars.append('DATASTORE_CONFIG')
cfg.default_worker = wcfg
cfg.to_file(get_resconfig_loc())
```
Loading