controller: list real profiles names instead of hardcoded test names
This commit is contained in:
parent
a614c1b54b
commit
6deb6c9643
3 changed files with 7 additions and 2 deletions
|
|
@ -46,7 +46,8 @@ class Application(object):
|
|||
|
||||
profile_factory = profiles.Factory()
|
||||
profile_merger = profiles.Merger()
|
||||
profile_loader = profiles.Loader(["/usr/lib/tuned", "/etc/tuned"], profile_factory, profile_merger)
|
||||
profile_locator = profiles.Locator(["/usr/lib/tuned", "/etc/tuned"])
|
||||
profile_loader = profiles.Loader(profile_locator, profile_factory, profile_merger)
|
||||
|
||||
self._daemon = daemon.Daemon(unit_manager, profile_loader, profile_name)
|
||||
self._controller = controller.Controller(self._daemon)
|
||||
|
|
|
|||
|
|
@ -113,4 +113,4 @@ class Controller(exports.interfaces.ExportableInterface):
|
|||
|
||||
@exports.export("", "as")
|
||||
def profiles(self):
|
||||
return ["a", "b", "c"]
|
||||
return self._daemon.profile_loader.profile_locator.get_known_names()
|
||||
|
|
|
|||
|
|
@ -65,6 +65,10 @@ class Daemon(object):
|
|||
def profile(self):
|
||||
return self._profile
|
||||
|
||||
@property
|
||||
def profile_loader(self):
|
||||
return self._profile_loader
|
||||
|
||||
def _thread_code(self):
|
||||
if self._profile is None:
|
||||
raise TunedException("Cannot start the daemon without setting a profile.")
|
||||
|
|
|
|||
Loading…
Reference in a new issue