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

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

Open
kwoodson opened this issue Oct 9, 2017 · 1 comment
Open

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

kwoodson opened this issue Oct 9, 2017 · 1 comment

Comments

@kwoodson
Copy link

kwoodson commented Oct 9, 2017

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:

  • Keep a hash of the paths that have been covered as to not descend more than once.
  • Add flag --no-symlinks

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

@nickjj
Copy link
Owner

nickjj commented Oct 10, 2017

Thanks for reporting in.

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

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