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

crashes on broken symlink #49

Closed
digitalist opened this issue May 18, 2017 · 1 comment · Fixed by #52
Closed

crashes on broken symlink #49

digitalist opened this issue May 18, 2017 · 1 comment · Fixed by #52
Labels

Comments

@digitalist
Copy link

digitalist commented May 18, 2017

$ gixy ~/temp/nginx/nginx.conf
[nginx_parser] WARNING File not found: /etc/nginx/mime.types #OK
[nginx_parser] WARNING File not found: /home/user/temp/nginx/conf.d/*.conf #OK
Traceback (most recent call last):
File "/usr/local/bin/gixy", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.5/dist-packages/gixy/cli/main.py", line 158, in main
yoda.audit(path, fdata, is_stdin=False)
File "/usr/local/lib/python3.5/dist-packages/gixy/core/manager.py", line 28, in audit
self.root = parser.parse(content=file_data.read(), path_info=file_path)
File "/usr/local/lib/python3.5/dist-packages/gixy/parser/nginx_parser.py", line 51, in parse
self.parse_block(parsed, root)
File "/usr/local/lib/python3.5/dist-packages/gixy/parser/nginx_parser.py", line 63, in parse_block
directive_inst = self.directive_factory(parsed_type, parsed_name, parsed_args)
File "/usr/local/lib/python3.5/dist-packages/gixy/parser/nginx_parser.py", line 77, in directive_factory
self.parse_block(children, inst)
File "/usr/local/lib/python3.5/dist-packages/gixy/parser/nginx_parser.py", line 61, in parse_block
self._resolve_include(parsed_args, parent)
File "/usr/local/lib/python3.5/dist-packages/gixy/parser/nginx_parser.py", line 109, in _resolve_include
return self._resolve_file_include(pattern=pattern, parent=parent)
File "/usr/local/lib/python3.5/dist-packages/gixy/parser/nginx_parser.py", line 117, in _resolve_file_include
self.parse_file(file_path, include)
File "/usr/local/lib/python3.5/dist-packages/gixy/parser/nginx_parser.py", line 26, in parse_file
content = open(path).read()
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/temp/nginx/sites-enabled/symlink_nm.org'
$ ls /home/user/temp/nginx/sites-enabled/symlink_nm.org
/home/user/temp/nginx/sites-enabled/symlink_nm.org #broken symlink here

@buglloc
Copy link
Member

buglloc commented May 21, 2017

Thanks! Fixed in Gixy v0.1.5

@buglloc buglloc closed this as completed May 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants