Using std.ssh with username and password causes TypeError

Bug #1849280 reported by Moshe Elisha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Undecided
Eyal B

Bug Description

Hi,

Using std.ssh with username and password (without private_key_filename) throws an error.

---
version: "2.0"
my_wf:
  tasks:
    execute_scripts:
      action: std.ssh
      input:
        cmd: ...
        host: ...
        username: ...
        password: ...

2019-10-21 16:35:26.447 6300 DEBUG mistral.utils.ssh_utils [-] Creating SSH connection execute_command /usr/lib/python2.7/site-packages/mistral/utils/ssh_utils.py:166
2019-10-21 16:35:26.447 6300 ERROR mistral.actions.std_actions [-] Failed to execute ssh cmd 'chmod 755 /tmp/donot_delete_folder/* ; sh /tmp/donot_delete_folder/configure_delay.sh' on [u'10.75.239.99'
] Exception: argument of type 'NoneType' is not iterable: TypeError: argument of type 'NoneType' is not iterable
2019-10-21 16:35:26.447 6300 ERROR mistral.actions.std_actions Traceback (most recent call last):
2019-10-21 16:35:26.447 6300 ERROR mistral.actions.std_actions File "/usr/lib/python2.7/site-packages/mistral/actions/std_actions.py", line 433, in run
2019-10-21 16:35:26.447 6300 ERROR mistral.actions.std_actions status_code, result = self._execute_cmd_method(**self.params)
2019-10-21 16:35:26.447 6300 ERROR mistral.actions.std_actions File "/usr/lib/python2.7/site-packages/mistral/utils/ssh_utils.py", line 170, in execute_command
2019-10-21 16:35:26.447 6300 ERROR mistral.actions.std_actions password)
2019-10-21 16:35:26.447 6300 ERROR mistral.actions.std_actions File "/usr/lib/python2.7/site-packages/mistral/utils/ssh_utils.py", line 43, in _to_paramiko_private_key
2019-10-21 16:35:26.447 6300 ERROR mistral.actions.std_actions if '../' in private_key_filename or '..\\' in private_key_filename:
2019-10-21 16:35:26.447 6300 ERROR mistral.actions.std_actions TypeError: argument of type 'NoneType' is not iterable
2019-10-21 16:35:26.447 6300 ERROR mistral.actions.std_actions
2019-10-21 16:35:26.448 6300 WARNING mistral.executors.default_executor [-] The action raised an exception [action_ex_id=89c7fda2-a8b7-4f86-9850-444af11a690c, msg='Failed to execute ssh cmd 'chmod 755
 /tmp/donot_delete_folder/* ; sh /tmp/donot_delete_folder/configure_delay.sh' on [u'10.75.239.99']', action_cls='<class 'mistral.actions.action_factory.SSHAction'>', attributes='{}', params='{u'userna
me': u'stack', u'cmd': u'chmod 755 /tmp/donot_delete_folder/* ; sh /tmp/donot_delete_folder/configure_delay.sh', u'host': u'10.75.239.99', u'password': u'oRQtW8ae_pdyCsaH'}']: ActionException: Failed
to execute ssh cmd 'chmod 755 /tmp/donot_delete_folder/* ; sh /tmp/donot_delete_folder/configure_delay.sh' on [u'10.75.239.99']
2019-10-21 16:35:26.448 6300 ERROR mistral.executors.default_executor Traceback (most recent call last):
2019-10-21 16:35:26.448 6300 ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/mistral/executors/default_executor.py", line 114, in run_action
2019-10-21 16:35:26.448 6300 ERROR mistral.executors.default_executor result = action.run(action_ctx)
2019-10-21 16:35:26.448 6300 ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/mistral/actions/std_actions.py", line 445, in run
2019-10-21 16:35:26.448 6300 ERROR mistral.executors.default_executor return raise_exc(parent_exc=e)
2019-10-21 16:35:26.448 6300 ERROR mistral.executors.default_executor File "/usr/lib/python2.7/site-packages/mistral/actions/std_actions.py", line 422, in raise_exc
2019-10-21 16:35:26.448 6300 ERROR mistral.executors.default_executor raise exc.ActionException(message)
2019-10-21 16:35:26.448 6300 ERROR mistral.executors.default_executor ActionException: Failed to execute ssh cmd 'chmod 755 /tmp/donot_delete_folder/* ; sh /tmp/donot_delete_folder/configure_delay.sh'
 on [u'10.75.239.99']
2019-10-21 16:35:26.448 6300 ERROR mistral.executors.default_executor

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/690015

Moshe Elisha (melisha)
Changed in mistral:
assignee: nobody → Eyal B (eyalb1)
Changed in mistral:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (stable/train)

Reviewed: https://review.opendev.org/690015
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=0a3cbfb5d6dd4f8b926b4d0f2ab5f9a2ea281419
Submitter: Zuul
Branch: stable/train

commit 0a3cbfb5d6dd4f8b926b4d0f2ab5f9a2ea281419
Author: Eyal <email address hidden>
Date: Tue Oct 22 12:05:43 2019 +0300

    Using std.ssh without private_key_filename causes TypeError

    Check the private_key_filename parameter only if it is not None

    Change-Id: If133cf472d1e0ecadd96bc07e7fd0d1ae4068740
    Closes-Bug: #1849280

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.opendev.org/690019
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=7d9c9ad71500caa4a36e7211c639b4c5f229d175
Submitter: Zuul
Branch: master

commit 7d9c9ad71500caa4a36e7211c639b4c5f229d175
Author: Eyal <email address hidden>
Date: Tue Oct 22 12:05:43 2019 +0300

    Using std.ssh without private_key_filename causes TypeError

    Check the private_key_filename parameter only if it is not None

    Depends-On: https://review.opendev.org/#/c/690040/
    Change-Id: If133cf472d1e0ecadd96bc07e7fd0d1ae4068740
    Closes-Bug: #1849280

Changed in mistral:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 9.0.1

This issue was fixed in the openstack/mistral 9.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 10.0.0.0b1

This issue was fixed in the openstack/mistral 10.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.