Merge lp:~milo/lava-tool/bug1206579 into lp:~linaro-validation/lava-tool/trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 190 | ||||
Proposed branch: | lp:~milo/lava-tool/bug1206579 | ||||
Merge into: | lp:~linaro-validation/lava-tool/trunk | ||||
Diff against target: |
397 lines (+168/-45) 6 files modified
integration-tests.d/lava-job-new-with-config.sh (+1/-1) lava/config.py (+47/-3) lava/helper/command.py (+4/-2) lava/testdef/tests/test_commands.py (+9/-4) lava/tests/test_config.py (+105/-34) setup.py (+2/-1) |
||||
To merge this branch: | bzr merge lp:~milo/lava-tool/bug1206579 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Antonio Terceiro | Approve | ||
Linaro Validation Team | Pending | ||
Review via email:
|
Description of the change
Added initial support for XDG directories.
The Config and InteractiveConfig class now will default to use $XDG_CONFIG_HOME as the directory where to store configurations. The dir tree will be as follows: $XDG_CONFIG_
The "linaro" part of the path, if somebody is using linaro-image-tools or other CLI tools, is already in place.
A new class, that inherits from InteractiveConfig has been introduced: InteractiveCache. This is exactly the same class as the other config ones, only it stores values in $XDG_CACHE_
The BaseCommand class has been fixed to use the new InteractiveCache class.
Tests have been added and fixed where necessary.
Looks good to me. :-)
review approve
> The BaseCommand class has been fixed to use the new InteractiveCache
> class.
So effectively InteractiveConfig in itself is now unused, apart from
being the base class for InteractiveCache. Config was already not used
directly ...
Maybe we could collapse the entire Config ← InteractiveConfig ←
InteractiveCache hierarchy into a single class?
Or do we want to create a scheme where the user *can* create an actual
config file that will provide defaults when prompting? Maybe a single
config object could load both config and cache files, and when something
is not found on cache, it falls back to the value in the config as
default when prompting ...
(not suggesting to do this for this MP though - just food for thought)