Fix traceback on indexing empty list (#21784)
* Fix traceback on indexing empty list * Make it more 'idiomatic' * Forgot the index
This commit is contained in:
parent
cba91c7f44
commit
8c521655e1
1 changed files with 4 additions and 1 deletions
|
@ -543,7 +543,10 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
||||||
|
|
||||||
cmd = self._connection._shell.expand_user(expand_path)
|
cmd = self._connection._shell.expand_user(expand_path)
|
||||||
data = self._low_level_execute_command(cmd, sudoable=False)
|
data = self._low_level_execute_command(cmd, sudoable=False)
|
||||||
initial_fragment = data['stdout'].strip().splitlines()[-1]
|
try:
|
||||||
|
initial_fragment = data['stdout'].strip().splitlines()[-1]
|
||||||
|
except IndexError:
|
||||||
|
initial_fragment = None
|
||||||
|
|
||||||
if not initial_fragment:
|
if not initial_fragment:
|
||||||
# Something went wrong trying to expand the path remotely. Return
|
# Something went wrong trying to expand the path remotely. Return
|
||||||
|
|
Loading…
Add table
Reference in a new issue