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

Visualizer decoding for OCI instance when not encoded in utf-8 #55

Closed
sunstarer opened this issue Jul 31, 2020 · 0 comments
Closed

Visualizer decoding for OCI instance when not encoded in utf-8 #55

sunstarer opened this issue Jul 31, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@sunstarer
Copy link

sunstarer commented Jul 31, 2020

instance['metadata']['user_data'] = base64.b64decode(instance['metadata']['user_data']).decode('utf-8')

Support many decoding options

Would like support for any decoding of data to support all possible encodings

Version 0.8.0

Backend Server

This is what I did to temporarily get around the issue, I don't think this is a good approach.

+                try:
+                    instance['metadata']['user_data'] = base64.b64decode(instance['metadata']['user_data']).decode('utf-8')
+                except Exception as error:
+                    logger.info(error)
+                    try:
+                        instance['metadata']['user_data'] = base64.b64decode(instance['metadata']['user_data']).decode('windows-1256')
+                    except Exception as error:
+                        raise error
@sunstarer sunstarer changed the title Visualizer decoding for OCI instance Visualizer decoding for OCI instance when not encoded in base64 Jul 31, 2020
@sunstarer sunstarer changed the title Visualizer decoding for OCI instance when not encoded in base64 Visualizer decoding for OCI instance when not encoded in utf-8 Aug 7, 2020
@toxophilist toxophilist added the bug Something isn't working label Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants