Browse Source

Merge "Getting numanode from all possible structure"

Jenkins 3 years ago
parent
commit
bc56d1c476
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      agent

+ 5
- 5
agent View File

@@ -945,13 +945,13 @@ class NodeAgent
945 945
 
946 946
     topology = {:numa_nodes => [], :supported_hugepages => supported_hugepages, :distances => [["1.0"]]}
947 947
 
948
-    doc.elements.each('/topology/object/distances/') do |dist|
948
+    doc.elements.each('//distances/') do |dist|
949 949
       topology[:distances] = dist.elements.collect{|v| v.attributes['value']}
950 950
         .each_slice(dist.attributes['nbobjs'].to_i).to_a
951 951
     end
952 952
 
953
-    numa_node = "/topology/object/object[@type='NUMANode']"
954
-    element = doc.elements[numa_node] ? numa_node : "/topology/object[@type='Machine']"
953
+    numa_node = "//object[@type='NUMANode']"
954
+    element = doc.elements["//object[@type='NUMANode']"] ? numa_node : "//object[@type='Machine']"
955 955
 
956 956
     doc.elements.each(element) do |numa|
957 957
 
@@ -959,10 +959,10 @@ class NodeAgent
959 959
       struct[:id] = numa.attributes['os_index'].to_i
960 960
       struct[:memory] = numa.attributes['local_memory'].to_i
961 961
 
962
-      numa.elements.each("object/object/object[@type='PU']") do |pu|
962
+      numa.elements.each("#{numa.xpath}//[@type='PU']") do |pu|
963 963
         struct[:cpus] << pu.attributes['os_index'].to_i
964 964
       end
965
-      numa.elements.each("object/object/object[@type='PCIDev']") do |pcidev|
965
+      numa.elements.each("#{numa.xpath}//[@type='PCIDev']") do |pcidev|
966 966
         struct[:pcidevs] << pcidev.attributes['pci_busid']
967 967
       end
968 968
       topology[:numa_nodes] << struct

Loading…
Cancel
Save