Merge "teststeps: Improvements and bugfixing of teststeps"
[vswitchperf.git] / core / loader / loader_servant.py
index 226b093..8bad9ab 100644 (file)
@@ -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: