ansible / ansible-container

DEPRECATED -- Ansible Container was a tool to build Docker images and orchestrate containers using only Ansible playbooks.
GNU Lesser General Public License v3.0
2.19k stars 392 forks source link

Prevent errors when src is none #872

Closed ehelms closed 6 years ago

ehelms commented 6 years ago
ISSUE TYPE
SUMMARY
ehelms commented 6 years ago

Testing blocked by -- https://github.com/ansible/ansible-container/pull/870

pilou- commented 6 years ago

When applied on devel, I confirm this pull-request fixes the following exception (occur with a copy task without src parameter):

Traceback (most recent call last):
  File "/usr/local/bin/conductor", line 11, in <module>
    load_entry_point('ansible-container', 'console_scripts', 'conductor')()
  File "/_ansible/container/__init__.py", line 19, in __wrapped__
    return fn(*args, **kwargs)
  File "/_ansible/container/cli.py", line 423, in conductor_commandline
    **params)
  File "/_ansible/container/__init__.py", line 19, in __wrapped__
    return fn(*args, **kwargs)
  File "/_ansible/container/core.py", line 809, in conductorcmd_build
    role_fingerprint = get_role_fingerprint(role, service_name, config_vars)
  File "/_ansible/container/__init__.py", line 19, in __wrapped__
    return fn(*args, **kwargs)
  File "/_ansible/container/utils/__init__.py", line 326, in get_role_fingerprint
    hash_role(hash_obj, resolve_role_to_path(role))
  File "/_ansible/container/utils/__init__.py", line 286, in hash_role
    hash_role(hash_obj, dependency_path)
  File "/_ansible/container/utils/__init__.py", line 286, in hash_role
    hash_role(hash_obj, dependency_path)
  File "/_ansible/container/utils/__init__.py", line 303, in hash_role
    if not os.path.exists(src) or not src.startswith(('/', '..')): continue
  File "/usr/lib/python2.7/genericpath.py", line 26, in exists
    os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found
ehelms commented 6 years ago

Thanks for testing @pilou- , this is now unblocked.

marcusianlevine commented 6 years ago

@j00bar @chouseknecht anything preventing this from being merged?