Fix python3 error in repoquery #4183

Merged
merged 1 commit into from May 18, 2017

Conversation

Projects
None yet
5 participants
@jpeeler
Contributor

jpeeler commented May 12, 2017

Explicitly convert from bytes to string so that splitting the string is
successful. This change works with python 2 as well.

Closes #4182

Fix python3 error in repoquery
Explicitly convert from bytes to string so that splitting the string is
successful. This change works with python 2 as well.

Closes #4182
@admiyo

Ran across this issue and the fix worked for me. If this is a python2 vs python3 error, consider using the Six module.

@abutcher abutcher requested a review from ashcrow May 16, 2017

@ashcrow

This will work. Made a note about a possible future fix to avoid this happening in other lib_utils modules.

@@ -48,7 +48,7 @@ def process_versions(query_output):
version_dict = defaultdict(dict)
- for version in query_output.split('\n'):
+ for version in query_output.decode().split('\n'):

This comment has been minimized.

@ashcrow

ashcrow May 16, 2017

Member

This will be hit by other items using _run (local ref). It may be a better fix to decode() before _run returns.

Here is what was done in lib_openshift.

@ashcrow

ashcrow May 16, 2017

Member

This will be hit by other items using _run (local ref). It may be a better fix to decode() before _run returns.

Here is what was done in lib_openshift.

@@ -45,7 +45,7 @@ def test_querying_a_package(self, mock_cmd):
# Return values of our mocked function call. These get returned once per call.
mock_cmd.side_effect = [
- (0, '4.2.46|21.el7_3|x86_64|rhel-7-server-rpms|4.2.46-21.el7_3', valid_stderr), # first call to the mock
+ (0, b'4.2.46|21.el7_3|x86_64|rhel-7-server-rpms|4.2.46-21.el7_3', valid_stderr), # first call to the mock

This comment has been minimized.

@ashcrow

ashcrow May 16, 2017

Member

👍 as b'' in Python 2 will become a str while staying bytes in 3.

@ashcrow

ashcrow May 16, 2017

Member

👍 as b'' in Python 2 will become a str while staying bytes in 3.

@ashcrow

This comment has been minimized.

Show comment
Hide comment
@ashcrow

ashcrow May 16, 2017

Member

aos-ci-test

Member

ashcrow commented May 16, 2017

aos-ci-test

@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot May 16, 2017

Member

success: "aos-ci-jenkins/OS_3.5_NOT_containerized, aos-ci-jenkins/OS_3.5_NOT_containerized_e2e_tests" for 7fb814d (logs)

Member

openshift-bot commented May 16, 2017

success: "aos-ci-jenkins/OS_3.5_NOT_containerized, aos-ci-jenkins/OS_3.5_NOT_containerized_e2e_tests" for 7fb814d (logs)

@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot May 16, 2017

Member

success: "aos-ci-jenkins/OS_3.6_containerized, aos-ci-jenkins/OS_3.6_containerized_e2e_tests" for 7fb814d (logs)

Member

openshift-bot commented May 16, 2017

success: "aos-ci-jenkins/OS_3.6_containerized, aos-ci-jenkins/OS_3.6_containerized_e2e_tests" for 7fb814d (logs)

@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot May 16, 2017

Member

success: "aos-ci-jenkins/OS_3.6_NOT_containerized, aos-ci-jenkins/OS_3.6_NOT_containerized_e2e_tests" for 7fb814d (logs)

Member

openshift-bot commented May 16, 2017

success: "aos-ci-jenkins/OS_3.6_NOT_containerized, aos-ci-jenkins/OS_3.6_NOT_containerized_e2e_tests" for 7fb814d (logs)

@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot May 16, 2017

Member

success: "aos-ci-jenkins/OS_3.5_containerized, aos-ci-jenkins/OS_3.5_containerized_e2e_tests" for 7fb814d (logs)

Member

openshift-bot commented May 16, 2017

success: "aos-ci-jenkins/OS_3.5_containerized, aos-ci-jenkins/OS_3.5_containerized_e2e_tests" for 7fb814d (logs)

@abutcher

This comment has been minimized.

Show comment
Hide comment
@abutcher

abutcher May 17, 2017

Member

[merge]

Member

abutcher commented May 17, 2017

[merge]

@abutcher

This comment has been minimized.

Show comment
Hide comment
@abutcher

This comment has been minimized.

Show comment
Hide comment
@abutcher

abutcher May 18, 2017

Member

[merge]

Member

abutcher commented May 18, 2017

[merge]

@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot May 18, 2017

Member

Evaluated for openshift ansible merge up to 7fb814d

Member

openshift-bot commented May 18, 2017

Evaluated for openshift ansible merge up to 7fb814d

@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot May 18, 2017

Member

[test]ing while waiting on the merge queue

Member

openshift-bot commented May 18, 2017

[test]ing while waiting on the merge queue

@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot May 18, 2017

Member

Evaluated for openshift ansible test up to 7fb814d

Member

openshift-bot commented May 18, 2017

Evaluated for openshift ansible test up to 7fb814d

@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot May 18, 2017

Member

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_openshift_ansible/127/) (Base Commit: eedd16a)

Member

openshift-bot commented May 18, 2017

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_openshift_ansible/127/) (Base Commit: eedd16a)

@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot May 18, 2017

Member

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_openshift_ansible/407/) (Base Commit: 2677014)

Member

openshift-bot commented May 18, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_openshift_ansible/407/) (Base Commit: 2677014)

@openshift-bot openshift-bot merged commit befb34a into openshift:master May 18, 2017

12 of 14 checks passed

fedora/25/atomic | origin/v3.6.0-alpha.1 Test failed with rc 2.
Details
aos-ci-jenkins/all Internal Jenkins error during provisioning the jenkins slave.
Details
aos-ci-jenkins/OS_3.5_NOT_containerized "openshift-ansible install passed"
Details
aos-ci-jenkins/OS_3.5_NOT_containerized_e2e_tests "e2e tests passed"
Details
aos-ci-jenkins/OS_3.5_containerized "openshift-ansible install passed"
Details
aos-ci-jenkins/OS_3.5_containerized_e2e_tests "e2e tests passed"
Details
aos-ci-jenkins/OS_3.6_NOT_containerized "openshift-ansible install passed"
Details
aos-ci-jenkins/OS_3.6_NOT_containerized_e2e_tests "e2e tests passed"
Details
aos-ci-jenkins/OS_3.6_containerized "openshift-ansible install passed"
Details
aos-ci-jenkins/OS_3.6_containerized_e2e_tests "e2e tests passed"
Details
continuous-integration/openshift-jenkins/merge Passed
continuous-integration/openshift-jenkins/test Passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 51.908%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment