浏览代码

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

Siddharth Wagle 10 年之前
父节点
当前提交
8235e7d63f
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      ambari-metrics/ambari-metrics-host-monitoring/src/test/python/unitTests.py

+ 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
 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)
     if base == "/":
       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
 
 def get_test_files(path, mask = None, recursive=True):