Normalize system info variables and report 35/33235/1
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Tue, 11 Apr 2017 07:35:45 +0000 (15:35 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Tue, 11 Apr 2017 07:35:45 +0000 (15:35 +0800)
Change-Id: I5627b4e2fa2287a1880433c7f25d9a2d1874cc26
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
tests/integration/compute.yaml
tests/integration/reports/system-info [moved from tests/integration/reports/inxi-system-info with 100% similarity]
tests/integration/tasks/inxi.yaml
tests/integration/templates/inxi-system-info.j2 [deleted file]
tests/integration/templates/system-info.j2 [new file with mode: 0644]

index cf9e659..62f8b5d 100644 (file)
@@ -78,6 +78,6 @@
 - hosts: local
   tasks:
   - name: create system information report
-    local_action: template src=templates/inxi-system-info.j2 dest=reports/inxi-system-info
+    local_action: template src=templates/system-info.j2 dest=reports/system-info
     delegate_to: localhost
   # TODO(yujunz) push test result to testapi
index a356040..6c2db6a 100644 (file)
@@ -40,4 +40,4 @@
       - '.+\sKernel:\s+(?P<kernel>.+)\sConsole'
       - '.+\s+HDD Total Size:\s+(?P<disk>.+)\s'
       - '.+\sproduct:\s+(?P<product>.+)\sv'
-  register: inxi_info
+  register: system_info
diff --git a/tests/integration/templates/inxi-system-info.j2 b/tests/integration/templates/inxi-system-info.j2
deleted file mode 100644 (file)
index 35c8661..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-System Information from inxi
-============================
-
-{% for host in groups['compute'] %}
-{{ hostvars[host].ansible_hostname }}
------------------------------
-
-{{ ('CPU Brand', hostvars[host].inxi_info.cpu[0])|justify }}
-{{ ('Disk', hostvars[host].inxi_info.disk[0])|justify }}
-{{ ('Host Name', hostvars[host].inxi_info.hostname[0])|justify }}
-{{ ('Kernel', hostvars[host].inxi_info.kernel[0])|justify }}
-{{ ('Memory', hostvars[host].inxi_info.memory[0])|justify }}
-{{ ('Operating System', hostvars[host].inxi_info.os[0])|justify }}
-{{ ('Product', hostvars[host].inxi_info.product[0])|justify }}
-
-{% endfor %}
diff --git a/tests/integration/templates/system-info.j2 b/tests/integration/templates/system-info.j2
new file mode 100644 (file)
index 0000000..305a2af
--- /dev/null
@@ -0,0 +1,16 @@
+System Information from inxi
+============================
+
+{% for host in groups['compute'] %}
+{{ hostvars[host].ansible_hostname }}
+-----------------------------
+
+{{ ('CPU Brand', hostvars[host].system_info.cpu[0])|justify }}
+{{ ('Disk', hostvars[host].system_info.disk[0])|justify }}
+{{ ('Host Name', hostvars[host].system_info.hostname[0])|justify }}
+{{ ('Kernel', hostvars[host].system_info.kernel[0])|justify }}
+{{ ('Memory', hostvars[host].system_info.memory[0])|justify }}
+{{ ('Operating System', hostvars[host].system_info.os[0])|justify }}
+{{ ('Product', hostvars[host].system_info.product[0])|justify }}
+
+{% endfor %}