Skip to content

salt-ssh can't work if root_dir path has blanks #61338

Description

@vladaurosh

Description
salt-ssh can't work if root_dir path has blanks

Setup
I am executing salt-ssh from /var/lib/jenkins/workspace/Test job and here I have following config dir with file:
salt/master.d/master
Content of this file is:

root_dir:/var/lib/jenkins/workspace/Test job/salt
ssh_log_file: log/ssh
file_roots:
  base:
    - /var/lib/jenkins/workspace/Test job/salt/base
pillar_roots:
  base:
    - /var/lib/jenkins/workspace/Test job/salt/pillars
roster_file: /var/lib/jenkins/workspace/Test job/salt/roster

Getting this when I execute salt-ssh:

> [ERROR   ] ERROR: Failure deploying thin, retrying:
> STDOUT:
> /usr/bin/scp
> _edbc7885e4f9aac9b83b35999b68d015148caf467b78fa39c05f669c0ff89878
> deploy
> 
> STDERR:
> WARNING: Unable to locate current code checksum: /var/tmp/.root_dd8a91_salt/code-checksum.
> 
> RETCODE: 11
> [ERROR   ] ERROR: Failure deploying thin, retrying:
> STDOUT:
> /usr/bin/scp
> _edbc7885e4f9aac9b83b35999b68d015148caf467b78fa39c05f669c0ff89878
> deploy
> 
> STDERR:
> WARNING: Unable to locate current code checksum: /var/tmp/.root_dd8a91_salt/code-checksum.

With debug turned on I see this issue:

> [DEBUG   ] Executing command: scp -o KbdInteractiveAuthentication=no -o PasswordAuthentication=no -o GSSAPIAuthentication=no -o ConnectTimeout=65 -o StrictHostKeyChecking=no -o Port=22 -o IdentityFile=key/pub_key.pem -o User=jenkins  /var/lib/jenkins/workspace/Test job/salt/var/cache/salt/master/thin/thin.tgz localhost:/var/tmp/.root_dd8a91_salt/salt-thin.tgz

And if I manually execute this scp command it doesn't work because of the blank space in path (Test job). If I wrap it in quotes it does work fine.

If I change root_dir to /tmp/Test_job/ it works fine.

  • on-prem machine
  • VM (Virtualbox, KVM, etc. please specify)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD

Steps to Reproduce the behavior
I am executing this command:
salt-ssh --ignore-host-keys --config-dir=salt/master.d '*' -l debug test.ping
with root_dir path set to one with blank space.

Expected behavior
Should work fine with root_dir path with blank spaces.
scp of thin.tgz should work if root_dir path has blank spaces.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report
CentOS Linux release 7.9.2009
salt-ssh 3004

PASTE HERE

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

Salt-SSHbugbroken, incorrect, or confusing behavior

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions