-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIXME: Use SettingPlugin to register config files
/* Incomplete version, the missing pieces are: * 1. fix symlinks location * 2. make sure LTS works well (disable vt_settings on LTS) */ Recently Avocado introduced a SettingPlugin, that allows Avocado plugins to register/modify paths to be processed by "avocado.core.settings". Let's use this instead of symlinking of our etc config files. For now we also have to keep the symlinking because the avocado 52.x (LTS) does not support this feature. Signed-off-by: Lukáš Doktor <[email protected]>
- Loading branch information
Showing
4 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# | ||
# See LICENSE for more details. | ||
# | ||
# Copyright: Red Hat Inc. 2018 | ||
# Author: Lukas Doktor <[email protected]> | ||
|
||
""" | ||
Avocado plugin that extends the settings path of our config paths | ||
""" | ||
|
||
import os | ||
from pkg_resources import resource_filename | ||
from pkg_resources import resource_isdir | ||
from pkg_resources import resource_listdir | ||
|
||
from avocado.core.plugin_interfaces import Settings | ||
|
||
|
||
class VTSettings(Settings): | ||
def adjust_settings_paths(self, paths): | ||
base = resource_filename('avocado_vt', 'conf.d') | ||
paths.extend([os.path.join(base, conf) | ||
for conf in resource_listdir('avocado_vt', 'conf.d') | ||
if conf.endswith('.conf')]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters