Skip to content

Conversation

@costimuraru
Copy link
Contributor

Fixes #1

@costimuraru costimuraru force-pushed the python3 branch 7 times, most recently from 0ac2eb0 to d642cbe Compare August 23, 2019 16:58
@@ -0,0 +1,24 @@
# Copyright 2019 Adobe. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use six (https://six.readthedocs.io/) for compatibility?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

def get_host_facts(self, host, indent="\t"):
vars = host.get_vars()
vars = {unicode(key): var for key, var in vars.items()} # the yaml dumper doesn't handle mixed keys encoding
vars = {str(key): var for key, var in vars.items()} # the yaml dumper doesn't handle mixed keys encoding
Copy link
Contributor

Choose a reason for hiding this comment

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

This entire line might not be needed at all. We could test that, or at least add a TODO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@costimuraru costimuraru force-pushed the python3 branch 2 times, most recently from 499f0a6 to f18aa1e Compare August 26, 2019 20:38
print

unicode

fixes

Signed-off-by: costimuraru <costimuraru@gmail.com>

fix inventory sorting

Signed-off-by: costimuraru <costimuraru@gmail.com>

publish

Signed-off-by: costimuraru <costimuraru@gmail.com>

Use python3 docker image

Signed-off-by: costimuraru <costimuraru@gmail.com>

Add patch version

test

Signed-off-by: costimuraru <costimuraru@gmail.com>

Add patch version

[RELEASE] - Release version 1.9.3

Fix travia

Fix

Signed-off-by: costimuraru <costimuraru@gmail.com>

Python3 fixes

Fix tests for python3

Fix version check

Signed-off-by: costimuraru <costimuraru@gmail.com>

[RELEASE] - Release version 1.9.4

Upgrade ops-cli

Use six for python3 compat check

Implement feedback

Show docker build command

Signed-off-by: costimuraru <costimuraru@gmail.com>
elif isinstance(value, str): # Python 2 str, check if it can be represented in utf8
value.encode('utf-8')
except UnicodeDecodeError as e:
print 'Invalid character in argument "{0}", most likely an "en dash", replace it with normal dash -'.format(
Copy link

@dancb10 dancb10 Aug 27, 2019

Choose a reason for hiding this comment

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

[not important] Maybe we can add an automatic replacement .replace(u'\u2014', '-', inplace=True) to skip this exception? Check if argument contains en dash and replace with with normal dash. Thus the user doesn't need to retype the command and change it's arguments

Signed-off-by: costimuraru <costimuraru@gmail.com>
@costimuraru costimuraru merged commit cbdb3ec into master Aug 27, 2019
@costimuraru costimuraru deleted the python3 branch August 27, 2019 15:05
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.

Move Opstool to python 3

5 participants