Przeglądaj źródła

AMBARI-3476. Time-series data are not coming thru via the API on CentOS 5 (graphs are being shown in Ganglia).

Mahadev Konar 11 lat temu
rodzic
commit
7e89b1116e

+ 12 - 1
ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrd.py

@@ -139,9 +139,20 @@ if "pt" in queryString:
   pointInTime = True
   pointInTime = True
 else:
 else:
   pointInTime = False
   pointInTime = False
+  
+def _walk(*args, **kwargs):
+ 
+  for root,dirs,files in os.walk(*args, **kwargs):
+    for dir in dirs:
+      qualified_dir = os.path.join(root,dir)
+      if os.path.islink(qualified_dir):
+        for x in os.walk(qualified_dir, **kwargs):
+          yield x
+    yield (root, dirs, files)
+    
 
 
 for cluster in clusterParts:
 for cluster in clusterParts:
-  for path, dirs, files in os.walk(rrdPath + cluster,followlinks=True):
+  for path, dirs, files in _walk(rrdPath + cluster):
     pathParts = path.split("/")
     pathParts = path.split("/")
     if len(hostParts) == 0 or pathParts[-1] in hostParts:
     if len(hostParts) == 0 or pathParts[-1] in hostParts:
       for file in files:
       for file in files: