-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix some python3 type issue on x509 #52014
Conversation
arsiesys
commented
Mar 7, 2019
Fix #52026 |
@arsiesys Thanks for providing fix. Can you add a test case ? We are now requiring test cases to be written for all PRs |
Hello @KChandrashekhar, I am sorry but I don't really have the bandwidth and time to work on it for now :(. As I am not really comfortable with the tests currently deployed, it would take time to learn this part. |
[salt/states/x509.py] Behavior: When you store the private key and a certificate in a same file, both have to be in the same format. But in python3, when the private key is already existing and get using "get_pem_entry", it will return a bytes. A new generated one will be in str. That mean that at the second execution, your state will fail. We have to convert the get_pem_entry return in a str using .decode(). [salt/modules/x509.py] Behavior: At each state execution, salt is making a comparison of the current key a new generated one. If one element (Subject, public key of the issuer...) differ, the key is replaced. In python3, the local key is in bytes while the remote key is provided in str. The compraison then fail $ Fix: - use .decode() on the return of get_public_key to be sure that the result will not be a bytes
re-run full all |
@arsiesys just FYI, we're working on getting 2019.2.1 stable, and then we'll look at merging these changes in. |