Python Unicode issue- for multiline custom facts output #252
Unanswered
eldho-varghese
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
I'm collecting a custom facts of NFS share name, and trying to display it in CMDB. I'm able to collect the data and display it in the fancy html page, however, the python unicode is formatting the output in an undesired way. Can anyone help me what would be the suitable code modification needed in html_fancy_defs.html so that I can display multi line output in a proper format.
Ansible CustomFact collection Logic
Ansible Playbook debug output
}
ok: [Server-1] => {
"nfsshare": [
"NetApp-vlan2:/vol/vol_GW_DG1/global",
"NetApp-vlan2:/vol/vol_WD_DW5/sapmnt",
"NetApp-vlan2:/vol/vol_GW_DG1/usr_sap_trans",
"NetApp-vlan2:/vol/vol_GW_DG1/profile",
"NetApp-vlan2:/vol/vol_GW_DG1/exe",
"NetApp-vlan2:/vol/vol_WD_DW5/usr_sap"
]
}
Output displayed in ansible CMDB
[u'NetApp-vlan2:/vol/vol_GW_DG1/global', u'NetApp-vlan2:/vol/vol_WD_DW5/sapmnt', u'NetApp-vlan2:/vol/vol_GW_DG1/usr_sap_trans', u'NetApp-vlan2:/vol/vol_GW_DG1/profile', u'NetApp-vlan2:/vol/vol_GW_DG1/exe', u'NetApp-vlan2:/vol/vol_WD_DW5/usr_sap']
html_fancy_defs.html logic
<%def name="col_nfsshare(host, **kwargs)">
${jsonxs(host, 'nfsshare', default='')}
</%def>
How can I modify the above html_fancy_defs logic so that I can get an output like below
Expected output
Thanks
Eldho Varghese
Beta Was this translation helpful? Give feedback.
All reactions