diff options
Diffstat (limited to 'core/loader/loader_servant.py')
-rw-r--r-- | core/loader/loader_servant.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/loader/loader_servant.py b/core/loader/loader_servant.py index 226b0931..8bad9ab9 100644 --- a/core/loader/loader_servant.py +++ b/core/loader/loader_servant.py @@ -1,4 +1,4 @@ -# Copyright 2015 Intel Corporation. +# Copyright 2015-2017 Intel Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -86,7 +86,8 @@ class LoaderServant(object): interface=self._interface) results = [] - for (name, mod) in list(out.items()): + # sort modules to produce the same output everytime + for (name, mod) in sorted(out.items()): desc = (mod.__doc__ or 'No description').strip().split('\n')[0] results.append((name, desc)) @@ -142,7 +143,7 @@ class LoaderServant(object): # find all classes derived from given interface, but suppress # interface itself and any abstract class starting with iface name gens = dict((k, v) for (k, v) in list(mod.__dict__.items()) - if type(v) == type and + if isinstance(v, type) and issubclass(v, interface) and not k.startswith(interface.__name__)) if gens: |