question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'list' object has no attribute 'endswith

See original GitHub issue

deploying luminous with ceph-ansible v3.0.0rc14

root@icadmin004:~# ansible-playbook --version
ansible-playbook 2.4.0.0
  config file = /root/git/ceph-ansible-luminous/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]
root@icadmin004:~# git branch
* (detached from v3.0.0rc14)
  master

ceph-ansible config : cluster-luminous.zip full ceph ansible log : ceph-ansible-luminous.log.zip

TASK [ceph-config : generate ceph configuration file: luminous.conf] ****************************************************************************************************************************************************************************************************************************************************
task path: /root/git/ceph-ansible-luminous/roles/ceph-config/tasks/main.yml:30
<iccluster007.iccluster.epfl.ch> ESTABLISH SSH CONNECTION FOR USER: None
<iccluster007.iccluster.epfl.ch> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=30 -o ControlPath=/root/.ansible/cp/%h-%r-%p iccluster007.iccluster.epfl.ch '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<iccluster015.iccluster.epfl.ch> ESTABLISH SSH CONNECTION FOR USER: None
<iccluster015.iccluster.epfl.ch> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=30 -o ControlPath=/root/.ansible/cp/%h-%r-%p iccluster015.iccluster.epfl.ch '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<iccluster019.iccluster.epfl.ch> ESTABLISH SSH CONNECTION FOR USER: None
<iccluster019.iccluster.epfl.ch> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=30 -o ControlPath=/root/.ansible/cp/%h-%r-%p iccluster019.iccluster.epfl.ch '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<iccluster007.iccluster.epfl.ch> (0, '/root\n', '')
<iccluster007.iccluster.epfl.ch> ESTABLISH SSH CONNECTION FOR USER: None
<iccluster007.iccluster.epfl.ch> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=30 -o ControlPath=/root/.ansible/cp/%h-%r-%p iccluster007.iccluster.epfl.ch '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1507105083.09-124081123181006 `" && echo ansible-tmp-1507105083.09-124081123181006="` echo /root/.ansible/tmp/ansible-tmp-1507105083.09-124081123181006 `" ) && sleep 0'"'"''
<iccluster015.iccluster.epfl.ch> (0, '/root\n', '')
<iccluster015.iccluster.epfl.ch> ESTABLISH SSH CONNECTION FOR USER: None
<iccluster015.iccluster.epfl.ch> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=30 -o ControlPath=/root/.ansible/cp/%h-%r-%p iccluster015.iccluster.epfl.ch '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1507105083.09-167559818295305 `" && echo ansible-tmp-1507105083.09-167559818295305="` echo /root/.ansible/tmp/ansible-tmp-1507105083.09-167559818295305 `" ) && sleep 0'"'"''
<iccluster019.iccluster.epfl.ch> (0, '/root\n', '')
<iccluster019.iccluster.epfl.ch> ESTABLISH SSH CONNECTION FOR USER: None
<iccluster019.iccluster.epfl.ch> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=30 -o ControlPath=/root/.ansible/cp/%h-%r-%p iccluster019.iccluster.epfl.ch '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1507105083.11-161751728823348 `" && echo ansible-tmp-1507105083.11-161751728823348="` echo /root/.ansible/tmp/ansible-tmp-1507105083.11-161751728823348 `" ) && sleep 0'"'"''
<iccluster015.iccluster.epfl.ch> (0, 'ansible-tmp-1507105083.09-167559818295305=/root/.ansible/tmp/ansible-tmp-1507105083.09-167559818295305\n', '')
<iccluster007.iccluster.epfl.ch> (0, 'ansible-tmp-1507105083.09-124081123181006=/root/.ansible/tmp/ansible-tmp-1507105083.09-124081123181006\n', '')
[DEPRECATION WARNING]: ansible.utils.unicode.to_bytes is deprecated.  Use ansible.module_utils._text.to_bytes instead. This feature will be removed in version 2.4. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: ansible.utils.unicode.to_bytes is deprecated.  Use ansible.module_utils._text.to_bytes instead. This feature will be removed in version 2.4. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: ansible.utils.unicode.to_unicode is deprecated.  Use ansible.module_utils._text.to_text instead. This feature will be removed in version 2.4. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: ansible.utils.unicode.to_unicode is deprecated.  Use ansible.module_utils._text.to_text instead. This feature will be removed in version 2.4. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
<iccluster019.iccluster.epfl.ch> (0, 'ansible-tmp-1507105083.11-161751728823348=/root/.ansible/tmp/ansible-tmp-1507105083.11-161751728823348\n', '')
[DEPRECATION WARNING]: ansible.utils.unicode.to_bytes is deprecated.  Use ansible.module_utils._text.to_bytes instead. This feature will be removed in version 2.4. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[DEPRECATION WARNING]: ansible.utils.unicode.to_unicode is deprecated.  Use ansible.module_utils._text.to_text instead. This feature will be removed in version 2.4. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 125, in run
    res = self._execute()
  File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 528, in _execute
    result = self._handler.run(task_vars=variables)
  File "/root/git/ceph-ansible-luminous/plugins/actions/_v2_config_template.py", line 521, in run
    convert_data=False
  File "/usr/lib/python2.7/dist-packages/ansible/template/__init__.py", line 450, in template
    disable_lookups=disable_lookups,
  File "/usr/lib/python2.7/dist-packages/ansible/template/__init__.py", line 672, in do_template
    res = j2_concat(rf)
  File "<template>", line 467, in root
  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 791, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 765, in _load_template
    template = self.loader.load(self, name, globals)
  File "/usr/lib/python2.7/dist-packages/jinja2/loaders.py", line 113, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/usr/lib/python2.7/dist-packages/jinja2/loaders.py", line 162, in get_source
    filename = path.join(searchpath, *pieces)
  File "/usr/lib/python2.7/posixpath.py", line 77, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'list' object has no attribute 'endswith'

fatal: [iccluster007.iccluster.epfl.ch]: FAILED! => {
    "failed": true, 
    "msg": "Unexpected failure during module execution.", 
    "stdout": ""
}
fatal: [iccluster015.iccluster.epfl.ch]: FAILED! => {
    "failed": true, 
    "msg": "'dict object' has no attribute u'ansible_localhost'"
}
fatal: [iccluster019.iccluster.epfl.ch]: FAILED! => {
    "failed": true, 
    "msg": "'dict object' has no attribute u'ansible_localhost'"
}

PLAY RECAP **************************************************************************************************************************************************************************************************************************************************************************************************************
iccluster007.iccluster.epfl.ch : ok=54   changed=3    unreachable=0    failed=1   
iccluster015.iccluster.epfl.ch : ok=52   changed=1    unreachable=0    failed=1   
iccluster019.iccluster.epfl.ch : ok=58   changed=1    unreachable=0    failed=1   
iccluster023.iccluster.epfl.ch : ok=2    changed=0    unreachable=0    failed=0   

Yoann Moulin

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
icamyscommented, Dec 5, 2017

@mistur Thank you! It worked.

1reaction
misturcommented, Dec 5, 2017

the patch seems to not be applied on this branch, to fix this issue, you just have to do this :

mv roles/ceph-common/templates/client_restapi_address.j2 roles/ceph-config/templates/ 
mv roles/ceph-common/templates/client_restapi_interface.j2 roles/ceph-config/templates/

Yoann

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: NoneType object has no attribute 'endswith'
The Python "AttributeError: 'NoneType' object has no attribute 'endswith'" occurs when we try to call the endswith() method on a None value, e.g....
Read more >
AttributeError: 'list' object has no attribute 'endswith'
I am trying to access a given folder, then access all of its sub folders (20+), and then access the only xlsx file...
Read more >
Django throws an error when a list is passed into self.stdout ...
The following piece of code throws an Attribute error stating that list' object has no attribute 'endswith', it is because the datatype of ......
Read more >
'NoneType' object has no attribute 'endswith' : r/django - Reddit
My first guess is that the module named trigger is not included in your path, therefore, it cannot evaluate the path variable in...
Read more >
AttributeError: 'list' object has no attribute 'endswich' - CSDN博客
所以我抱着怀疑的态度,去翻找了一下我自己写的代码,发现我写错成了endswich。 其实正确拼写是endswith啊!!! # 数据集主目录.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found