saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.11k stars 5.47k forks source link

[BUG] The nexus module does not work with Python 3 #63560

Open fast90 opened 1 year ago

fast90 commented 1 year ago

Description The nexus module does not work since upgrading minion to 3004.2 the nexus.downloaded state fails with error "expected bytes-like object".

Setup Master (3004.2) is running on Ubuntu Server, minion(3004.2) is running on Windows 10 machine.

Steps to Reproduce the behavior Run this state with described minion version

downloadtest:
  nexus.downloaded:
    - artifact:
        nexus_url: https://mynexusrepo.com/respository
        repository: 'test'
        packaging: '7z'
        group_id: 'testgrop'
        artifact_id: 'testartifact'
        username: 'user'
        password: 'supersecrect'
        version: '1.0'
    - target_file: C:\Temp\test.7z

Expected behavior The file should be downloaded without failing.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.) Master: ```yaml Salt Version: Salt: 3004.2 Dependency Versions: cffi: Not Installed cherrypy: Not Installed dateutil: 2.7.3 docker-py: Not Installed gitdb: 2.0.6 gitpython: 3.0.7 Jinja2: 2.10.1 libgit2: 0.28.3 M2Crypto: Not Installed Mako: Not Installed msgpack: 0.6.2 msgpack-pure: Not Installed mysql-python: Not Installed pycparser: Not Installed pycrypto: Not Installed pycryptodome: 3.6.1 pygit2: 1.0.3 Python: 3.8.10 (default, Jun 22 2022, 20:18:18) python-gnupg: 0.4.5 PyYAML: 5.3.1 PyZMQ: 18.1.1 smmap: 2.0.5 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.3.2 System Versions: dist: ubuntu 20.04 focal locale: utf-8 machine: x86_64 release: 5.4.0-126-generic system: Linux version: Ubuntu 20.04 focal ``` Minion ```yaml Salt Version: Salt: 3004.2 Dependency Versions: cffi: 1.14.6 cherrypy: 18.6.1 dateutil: 2.8.1 docker-py: Not Installed gitdb: 4.0.7 gitpython: Not Installed Jinja2: 2.10.1 libgit2: Not Installed M2Crypto: Not Installed Mako: 1.1.4 msgpack: 0.6.2 msgpack-pure: Not Installed mysql-python: Not Installed pycparser: 2.20 pycrypto: Not Installed pycryptodome: 3.10.1 pygit2: Not Installed Python: 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] python-gnupg: 0.4.7 PyYAML: 5.4.1 PyZMQ: 19.0.0 smmap: 4.0.0 timelib: 0.2.4 Tornado: 4.5.3 ZMQ: 4.3.2 System Versions: dist: locale: cp1252 machine: AMD64 release: 2019 system: Windows version: 2019 10.0.17763 SP0 Multiprocessor Free ```

Additional context This looks like the same problem mentioned in https://github.com/saltstack/salt/issues/56660. I can provide a pull request applying the same fix to the nexus module.

welcome[bot] commented 1 year ago

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

fast90 commented 1 year ago

PR: https://github.com/saltstack/salt/pull/63562