Browse Source

AMBARI-7679. Add psutil based resource monitoring to collect host metrics. Unitests.py python version. (swagle)

Siddharth Wagle 10 years ago
parent
commit
8235e7d63f

+ 6 - 1
ambari-metrics/ambari-metrics-host-monitoring/src/test/python/unitTests.py

@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
 '''
 '''
 Licensed to the Apache Software Foundation (ASF) under one
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 or more contributor license agreements.  See the NOTICE file
@@ -39,7 +41,10 @@ def get_parent_path(base, directory_name):
     base = os.path.dirname(base)
     base = os.path.dirname(base)
     if base == "/":
     if base == "/":
       return None
       return None
-    done = True if os.path.split(base)[-1] == directory_name else False
+    if os.path.split(base)[-1] == directory_name:
+      done = True
+    else:
+      done = False
   return base
   return base
 
 
 def get_test_files(path, mask = None, recursive=True):
 def get_test_files(path, mask = None, recursive=True):