Skip to content

Commit 833e5ac

Browse files
committed
Changes for issues found porting over to Python3
1 parent 489186f commit 833e5ac

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

ansible/rebuild_module.digest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d525f2e1e4a00799609cafff59726f38 -
1+
79380cf9ababbd7680f5a271720f8883 -

ansible/roles/openshift_client_python/library/openshift_client_python.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openshift/base_verbs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ def build_secret_dockerconfigjson(secret_name, image_registry_auth_infos, obj_la
744744
the yaml to the server with create()). This method does not use/require oc to be resident
745745
on the python host.
746746
:param secret_name: The metadata.name to include
747-
:paran image_registry_auth_infos: An iterable collection of ImageRegistryAuthInfo
747+
:param image_registry_auth_infos: An iterable collection of ImageRegistryAuthInfo
748748
:param obj_labels: Additional labels to include in the resulting secret metadata.
749749
:return: A python dict of a secret resource.
750750
"""
@@ -755,7 +755,7 @@ def build_secret_dockerconfigjson(secret_name, image_registry_auth_infos, obj_la
755755
auths = {} # A map of registry urls to a map with a single element called 'auth'
756756

757757
for ira in image_registry_auth_infos:
758-
b64_username_password = base64.b64encode('{}:{}'.format(ira.username, ira.password))
758+
b64_username_password = base64.b64encode('{}:{}'.format(ira.username, ira.password).encode()).decode()
759759
auths[ira.registry_url] = {
760760
'auth': b64_username_password
761761
}
@@ -769,7 +769,7 @@ def build_secret_dockerconfigjson(secret_name, image_registry_auth_infos, obj_la
769769
import json
770770

771771
# Next, base64 encode the entire file.
772-
b64_dockerconfigjson = base64.b64encode(json.dumps(dockerconfig, indent=4))
772+
b64_dockerconfigjson = base64.b64encode(json.dumps(dockerconfig, indent=4).encode()).decode()
773773

774774
# And stick it into the secret's data
775775
data = {

packages/openshift/test_selector.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ def test_qname_matches(self):
2525
def test_set_operations(self):
2626
s1 = selector([])
2727
s2 = selector(['pod/abc', 'pod/xyz'])
28-
self.assertEquals(s1.subtract(s2).qnames(), [])
29-
self.assertEquals(s1.union(s2).qnames(), ['pod/abc', 'pod/xyz'])
28+
self.assertEqual(s1.subtract(s2).qnames(), [])
29+
self.assertEqual(s1.union(s2).qnames(), ['pod/abc', 'pod/xyz'])
3030

3131
s3 = selector(['pod/abc2', 'pod/xyz'])
32-
self.assertEquals(s2.subtract(s3).qnames(), ['pod/abc'])
33-
self.assertEquals(s2.intersect(s3).qnames(), ['pod/xyz'])
32+
self.assertEqual(s2.subtract(s3).qnames(), ['pod/abc'])
33+
self.assertEqual(s2.intersect(s3).qnames(), ['pod/xyz'])
3434

3535
# See whether fuzzy matching of kinds is working
3636

0 commit comments

Comments
 (0)