saltstack / saltstack/salt

highstate_doc:

Open
#56,058 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug python3 severity-high
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description of Issue

File "/usr/lib/python3/dist-packages/salt/modules/highstate_doc.py", line 688, in proccesser_markdown
'requisites': requisites.decode('utf-8'),
AttributeError: 'str' object has no attribute 'decode'

I looked into the file. I think this worked with python2 but not with python3: file is loaded knowing it is utf-8 encoded -> all internal strings are now Unicode and these objects have no decode function. Fixed removing decode("utf-8"). But then I get: 'salt.highstate_doc.render' is not available?

Setup

I used the documentation to see highstate_doc in action:
https://docs.saltstack.com/en/develop/ref/modules/all/salt.modules.highstate_doc.html

Steps to Reproduce Issue
  • Add pillar highstate_doc.sls as in documentation above
    [We didn't add the first state, because we thought it was optional]
  • Add state makereadme.sls as in documentation above
  • Run salt-call state.apply makereadme
Versions Report

salt --versions-report

Salt Version:
Salt: 2019.2.2

Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.6.1
docker-py: Not Installed
gitdb: 2.0.3
gitpython: 2.1.8
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 3.6.9 (default, Nov 7 2019, 10:44:02)
python-gnupg: 0.4.1
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: 2.0.3
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.2.5

System Versions:
dist: Ubuntu 18.04 bionic
locale: ANSI_X3.4-1968
machine: x86_64
release: 4.15.0-64-generic
system: Linux
version: Ubuntu 18.04 bionic

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with /usr/lib/python3/dist-packages/salt/modules/highstate_doc.py at proccesser_markdown around line 688, then compare the documented highstate_doc setup with the reported salt-call state.apply makereadme reproduction. Confirm the fix handles Python 3 strings and investigate why salt.highstate_doc.render is unavailable; done means the documented example runs successfully on Python 3.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.