UnboundLocalError: local variable 'cmd' referenced before assignment

Bug #1587941 reported by Staroverov Anton on 2016-06-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rally
Undecided
Alexander Maretskiy

Bug Description

During launching of VM task got following message:
--------------------------------------------------------------------------------
Task b21d2ccf-ebc4-4bc6-88cd-c800297c05ae has 1 error(s)
--------------------------------------------------------------------------------UnboundLocalError: local variable 'cmd' referenced before assignmentTraceback (most recent call last):
 File "/home/stack/rally/local/lib/python2.7/site-packages/rally/task/runner.py", line 66, in _run_scenario_once
   getattr(scenario_inst, method_name)(**scenario_kwargs)
 File "/home/stack/rally/local/lib/python2.7/site-packages/rally/plugins/openstack/scenarios/vm/vmtasks.py", line 168, in boot_runcommand_delete
   fip["ip"], port, username, password, command=command)
 File "/home/stack/rally/local/lib/python2.7/site-packages/rally/plugins/openstack/scenarios/vm/utils.py", line 234, in _run_command
   return self._run_command_over_ssh(ssh, command)
 File "/home/stack/rally/local/lib/python2.7/site-packages/rally/task/atomic.py", line 84, in func_atomic_actions
   f = func(self, *args, **kwargs)
 File "/home/stack/rally/local/lib/python2.7/site-packages/rally/plugins/openstack/scenarios/vm/utils.py", line 141, in _run_command_over_ssh
   return ssh.execute(cmd, stdin=stdin)
UnboundLocalError: local variable 'cmd' referenced before assignment

http://paste.openstack.org/show/506988/

Alexander Maretskiy (maretskiy) wrote :

Rally version: commit 9272f6d69eaeedba8e685e4e2497dc14118abcbc (above release 0.4.0)

Changed in rally:
status: New → Confirmed
Changed in rally:
assignee: nobody → Alexander Maretskiy (maretskiy)

Fix proposed to branch: master
Review: https://review.openstack.org/325189

Changed in rally:
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/325189
Committed: https://git.openstack.org/cgit/openstack/rally/commit/?id=567b9d975b6a2e97ed67da59d78e4f1b25687e7d
Submitter: Jenkins
Branch: master

commit 567b9d975b6a2e97ed67da59d78e4f1b25687e7d
Author: Alexander Maretskiy <email address hidden>
Date: Fri Jun 3 11:56:59 2016 +0300

    [Plugins] Fix vm.utils._run_command_over_ssh

    Method vm.utils._run_command_over_ssh has been reworked,
    also there are related changes in task.validation:
      * command parameters are processed in different way,
        so UnboundLocalError and another potential issues
        are resolved
      * removed redundant check `validation.check_command_dict',
        because scenarios which uses _run_command_over_ssh already
        check command with validator `validation.valid_command',
        so `check_command_dict' is run twice
      * as result, unit test `test__run_command_over_ssh_fails'
        is removed since it checks invocation of
        `check_command_dict' by `_run_command_over_ssh'
      * os.path.expanduser is moved from check_command_dict
        to _run_command_over_ssh since validation should not modify
        data, especially when it is being done implicitly
      * unit test `validation.check_command_dict' is extended
        and rewritten with DDT

    Change-Id: Ib14012bf6e91fd6f7b4dd32766daa191c320e314
    Closes-Bug: 1587941

Changed in rally:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers