fboender / ansible-cmdb

Generate host overview from ansible fact gathering output
GNU General Public License v3.0
2.35k stars 467 forks source link

SQL.tpl: Duplicate return statement for in if/else #88

Closed randyr505 closed 8 years ago

randyr505 commented 8 years ago

In the sql.tpl file the if/else statement seems to do the same thing. Either the else: and following statement needs to be removed or a different variable needs to be set. I don't have and OpenBSD to test so I didn't propose a solution.

<%def name="col_os_name(host)"><% if jsonxs(host, 'ansible_facts.ansible_distribution', default='') in ["OpenBSD"]: return jsonxs(host, 'ansible_facts.ansible_distribution', default='') else: return jsonxs(host, 'ansible_facts.ansible_distribution', default='') endif %>

fboender commented 8 years ago

Hey Randy,

Yeah, that's totally pointless. The code was changed a few commits back to be more forgiving with regards to non-existing fields, and I must have forgotten to take that check out.

Thanks for pointing it out! I've removed the check and committed the change.