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

Fix bytes returned from hex fingerprint -o tsv #3053

Merged
merged 3 commits into from Apr 28, 2017

Conversation

devigned
Copy link
Member

The hex fingerprint of a Key Vault certificate returns as bytes in py3. This corrects that and returns a str as the method says it should.

$ az keyvault certificate show --vault-name testvaultdj -n testcert --query "x509ThumbprintHex" -o tsv
b'73863FFDAD3BA0E7C08BAEFBAD09F661298341C6'

After the fix

$ az keyvault certificate show --vault-name testvaultdj -n testcert --query "x509ThumbprintHex" -o tsv
73863FFDAD3BA0E7C08BAEFBAD09F661298341C6

@codecov-io
Copy link

codecov-io commented Apr 27, 2017

Codecov Report

Merging #3053 into master will decrease coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3053      +/-   ##
==========================================
- Coverage   63.15%   63.15%   -0.01%     
==========================================
  Files         484      484              
  Lines       27628    27631       +3     
  Branches     4281     4282       +1     
==========================================
+ Hits        17449    17450       +1     
- Misses       9027     9028       +1     
- Partials     1152     1153       +1
Impacted Files Coverage Δ
src/azure-cli-core/azure/cli/core/util.py 66.42% <50%> (-0.75%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6426ac...7d483e3. Read the comment docs.

Copy link
Contributor

@troydai troydai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a test.

@devigned
Copy link
Member Author

damn... @troydai. I knew you were going to say that. I'll add a test.

@troydai
Copy link
Contributor

troydai commented Apr 27, 2017

I'm too predictable.

@derekbekoe
Copy link
Member

Looks good but does it work with Python 2 and 3?

$ python
Python 2.7.10 (default, Feb  6 2017, 23:53:20) 
>>> bytes
<type 'str'>
>>> 
$ python3
Python 3.5.1 (v3.5.1:37a07cee5969, Dec  5 2015, 21:12:44) 
>>> bytes
<class 'bytes'>
>>> 

@devigned
Copy link
Member Author

@derekbekoe should be good. I'll prove with a test.

$ az keyvault certificate show --vault-name level1zb4tc -n sp-cert-level1 --query "x509ThumbprintHex" -o tsv
3EF38981A3EAE51D34E06C93D6D074216DD75323
(env27)

@devigned devigned merged commit de92b07 into Azure:master Apr 28, 2017
@devigned devigned deleted the fix-hex-fingerprint branch April 28, 2017 16:13
@devigned devigned restored the fix-hex-fingerprint branch May 10, 2017 01:18
@devigned devigned deleted the fix-hex-fingerprint branch May 10, 2017 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants