Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Using source_hash when renaming a file shows warning of unsupported protocol #66976

Open
2 tasks done
ben-grande opened this issue Oct 17, 2024 · 0 comments
Open
2 tasks done
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@ben-grande
Copy link

Description

file.managed documentation states that source_hash:

When using a source hash file the source_hash argument needs to be a url, the standard download urls are supported, ftp, http, salt etc

Local file could be mentioned before the "etc".

It was fixed in code in:

Having the warning message is worrying because it is read as it no checksum was made, but it was made, as I tested with the wrong checksum and it failed.

Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)

Please be as specific as possible and give set-up details.

  • VM (Virtualbox, KVM, etc. please specify) - Xen - QubesOS
  • classic packaging - packaged by Qubes developers

Steps to Reproduce the behavior
(Include debug logs if possible and relevant)

I ran the state locally.

id:
  file.managed:
    - name: /tmp/a
    - source: /tmp/b
    - source_hash: sha256=theshasum
[WARNING ] source_hash is only used with 'http', 'https' or 'ftp'

File is correctly copied if the hash is correct and not copied if it is incorrect.

In case it is incorrect:

     Comment: Specified sha256 checksum for /var/lib/qubes/vm-kernels/vmlinuz (18a1ee52574b9a4fc5eda265922bcbcface90f7c43ed7a68dc8e201a2ac0a7dc) does not match actual checksum (78a1ee52574b9a4fc5eda265922bcbcface90f7c43ed7a68dc8e201a2ac0a7dc)

Expected behavior

No warning message and the documentation stating that local files are also supported.

Versions Report

No difference in master and minion version.

Salt Version:
          Salt: 3006.9

Python Version:
        Python: 3.11.6 (main, Oct  3 2023, 00:00:00) [GCC 12.3.1 20230508 (Red Hat 12.3.1-1)]

Dependency Versions:
          cffi: 1.15.1
      cherrypy: Not Installed
  cryptography: Not Installed
      dateutil: 2.8.2
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.0.3
       libgit2: 1.3.1
  looseversion: 1.2.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.4
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 21.3
     pycparser: 2.20
      pycrypto: Not Installed
  pycryptodome: 3.19.0
        pygit2: 1.7.1
  python-gnupg: Not Installed
        PyYAML: 6.0
         PyZMQ: 23.2.0
        relenv: Not Installed
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: qubes 4.2.3 R4.2
        locale: utf-8
       machine: x86_64
       release: 6.6.48-1.qubes.fc37.x86_64
        system: Linux
       version: Qubes OS 4.2.3 R4.2

Additional context

@ben-grande ben-grande added Bug broken, incorrect, or confusing behavior needs-triage labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant