nickjj / ansigenome

A tool to help you gather information and manage your Ansible roles.
GNU General Public License v3.0
449 stars 64 forks source link

parser fails due to "Too many levels of symbolic links" #62

Open kwoodson opened 7 years ago

kwoodson commented 7 years ago

I attempted to run this on my repository to get a feel for what our graph looks like and it failed with the error message:

Traceback (most recent call last):
  File "./ansigenome", line 326, in <module>
    main()
  File "./ansigenome", line 322, in main
    fn(args, options, reloaded_config, parser)
  File "./ansigenome", line 153, in execute_scan
    Scan(args, options, config)
  File "/home/kwoodson/git/ansigenome/ansigenome/scan.py", line 83, in __init__
    self.scan_roles()
  File "/home/kwoodson/git/ansigenome/ansigenome/scan.py", line 117, in scan_roles
    self.report["roles"][key] = self.report_role(key)
  File "/home/kwoodson/git/ansigenome/ansigenome/scan.py", line 185, in report_role
    "total_lines": self.gather_lines(),
  File "/home/kwoodson/git/ansigenome/ansigenome/scan.py", line 315, in gather_lines
    with open(full_path, "r") as f:
IOError: [Errno 40] Too many levels of symbolic links: '/home/kwoodson/git/openshift-ansible/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks/roles/openshift_certificate_expiry/examples/playbooks'

It looks like it started doing a recursive decent and was broken by the symlinks.

Possible fixes:

If I can find some time I'll look at submitting a patch.

nickjj commented 7 years ago

Thanks for reporting in.

I'd really appreciate if you could look into patching that as it does seem like a legit bug.