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 iam create-virtual-mfa-device to work with relative output paths. #1002

Conversation

quiver
Copy link
Contributor

@quiver quiver commented Nov 13, 2014

http://docs.aws.amazon.com/cli/latest/reference/iam/create-virtual-mfa-device.html

If you specify output filename with relative path for iam-CreateVirtualMFADevice, you end up with write error

$ aws iam create-virtual-mfa-device --virtual-mfa-device-name test --bootstrap-method QRCodePNG --outfile QRCode.png
Unable to write to file: QRCode.png

If you specify absolute path(like /tmp/QRCode.png), this works just fine.

This is because aws checks for outfile' s write availability before it actually writes to it, and this is done through outfile's parent directory's write permission. So if you cannot restore outfile's parent path from given argument, os.access(parent_dir, os.W_OK) always fails.

@jamesls
Copy link
Member

jamesls commented Dec 8, 2014

Looks great, thanks. Also thanks for adding tests! I'll be merging this shortly.

@jamesls
Copy link
Member

jamesls commented Dec 9, 2014

Rebased and merged via 493399f Thanks again.

@jamesls jamesls closed this Dec 9, 2014
@quiver quiver deleted the fix-iam-CreateVirtualMFADevice-for-relative-outfile-path branch November 14, 2015 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants