Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu_type list index out of range #68

Closed
dcj opened this issue Apr 12, 2016 · 1 comment
Closed

cpu_type list index out of range #68

dcj opened this issue Apr 12, 2016 · 1 comment

Comments

@dcj
Copy link

dcj commented Apr 12, 2016

Got this error:

If you can, also include the hosts file and the facts file for the last host
that rendered properly ('Rendering host...' in the output. If these files must
remain confidential, you can send them to ferry.boender@gmail.com instead.
(a2)➜  acmdb ansible-cmdb -d out/ > overview.html
data_dir = /usr/local/Cellar/ansible-cmdb/1.13/ansiblecmdb/data
tpl_dir = /usr/local/Cellar/ansible-cmdb/1.13/ansiblecmdb/data/tpl
static_dir = /usr/local/Cellar/ansible-cmdb/1.13/ansiblecmdb/data/static
Parsing fact dir: out/
Reading host facts from out/dcs.dc.drivescale.com

DELETED

Reading host facts from out/u40.r2.dc.drivescale.com
template file = /usr/local/Cellar/ansible-cmdb/1.13/ansiblecmdb/data/tpl/html_fancy.tpl
Template params: {'lib_dir': '/usr/local/Cellar/ansible-cmdb/1.13/ansiblecmdb/data', 'version': '1.13', 'data_dir': '/usr/local/Cellar/ansible-cmdb/1.13/ansiblecmdb/data', 'log': <logging.RootLogger object at 0x107a4ad50>, 'columns': None}
Rendering host overview for u14.r3.hq.drivescale.com

DELETED

Rendering host overview for u14s2x.r2.dc.drivescale.com


Traceback (most recent call last):
  File "/usr/local/bin/ansible-cmdb", line 108, in <module>
    out = mytemplate.render(hosts=ansible.hosts, **params)
  File "/usr/local/Cellar/ansible-cmdb/1.13/mako/template.py", line 443, in render
    return runtime._render(self, self.callable_, args, data)
  File "/usr/local/Cellar/ansible-cmdb/1.13/mako/runtime.py", line 803, in _render
    **_kwargs_for_callable(callable_, data))
  File "/usr/local/Cellar/ansible-cmdb/1.13/mako/runtime.py", line 835, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/usr/local/Cellar/ansible-cmdb/1.13/mako/runtime.py", line 860, in _exec_template
    callable_(context, *args, **kwargs)
  File "/usr/local/Cellar/ansible-cmdb/1.13/ansiblecmdb/data/tpl/html_fancy.tpl", line 522, in render_body
    <td>${col["func"](host)}</td>
  File "/usr/local/Cellar/ansible-cmdb/1.13/ansiblecmdb/data/tpl/html_fancy.tpl", line 0, in col_cpu_type

  File "/usr/local/Cellar/ansible-cmdb/1.13/ansiblecmdb/data/tpl/html_fancy.tpl", line 92, in render_col_cpu_type
    ${ cpu_type[-1] }
IndexError: list index out of range

Whoops, it looks like something went wrong while rendering the template.

The reported error was: list index out of range
@fboender
Copy link
Owner

Hey Don!

Thanks for the bugreport. Looks like ansible thinks that machine has no CPUs (although it has a core). I've added an extra check for this, so this problem should be fixed in master. You can try out master or you can wait until a new release comes out (which is soon).

Regards

@fboender fboender changed the title Error cpu_type list index out of range Apr 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants