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

error running, content referenced before assignment and object of type 'NoneType' has no len() #2

Open
cvernooy23 opened this issue Nov 7, 2019 · 2 comments

Comments

@cvernooy23
Copy link

python
Python 3.7.5 (default, Nov  1 2019, 02:16:32) 
[Clang 11.0.0 (clang-1100.0.33.8)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ansidoc import Ansidoc
>>> ansidoc = Ansidoc(dirpath='/full/path/to/ansible/project/roles')
>>> ansidoc.run()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/ansidoc/ansidoclib.py", line 118, in run
    self._make_role_doc(os.path.join(self.dirpath, role))
  File "/usr/local/lib/python3.7/site-packages/ansidoc/ansidoclib.py", line 62, in _make_role_doc
    os.path.join(rolepath, "docs"), self.verbose)
  File "/usr/local/lib/python3.7/site-packages/ansidoc/helpers.py", line 32, in load_yml_files
    return content
UnboundLocalError: local variable 'content' referenced before assignment
ansidoc -p /full/path/to/ansible/project/roles
Traceback (most recent call last):
  File "/usr/local/bin/ansidoc", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/ansidoc/__main__.py", line 33, in main
    exit_code = cli.run(**vars(args))
  File "/usr/local/lib/python3.7/site-packages/ansidoc/cli.py", line 53, in run
    ansidoc.run()
  File "/usr/local/lib/python3.7/site-packages/ansidoc/ansidoclib.py", line 114, in run
    if len(exclude_list) > 0:
TypeError: object of type 'NoneType' has no len()
@angeloxx
Copy link

angeloxx commented Dec 7, 2022

The script requires that role directory contains ./docs directory, even if empty

@rod7760
Copy link

rod7760 commented Nov 3, 2023

While I do understand that it requires an empty docs dir, this seems like an unnecessary restriction. Is there a particular reason this is done?

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

3 participants