Fix security issues of eval-s in testapi
[releng.git] / utils / test / result_collection_api / opnfv_testapi / tests / unit / test_fake_pymongo.py
index 9a1253e..5f50ba8 100644 (file)
@@ -115,7 +115,8 @@ class MyTest(AsyncHTTPTestCase):
             self.assertEqual(name_error, error)
 
     def _eval_pods_db(self, method, *args, **kwargs):
-        return eval('self.db.pods.%s(*args, **kwargs)' % method)
+        table_obj = vars(self.db)['pods']
+        return table_obj.__getattribute__(method)(*args, **kwargs)
 
 
 if __name__ == '__main__':