Skip to content

Commit 3cb09a5

Browse files
authored
Merge pull request #43 from yashgiri/master
Porting via modernize -- verify works
2 parents da5ec9d + c89cd64 commit 3cb09a5

24 files changed

Lines changed: 65 additions & 35 deletions

ansible/rebuild_module.digest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
47d4a849eeec07d67f5c4d3927f75121 -
1+
d2a3d6de4ff5eddbaeecfea6d04d42a8 -

ansible/roles/openshift_client_python/library/openshift_client_python.py

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

ansible/roles/openshift_client_python/library/openshift_client_python.template.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import print_function
44

5+
from __future__ import absolute_import
56
from ansible.module_utils.basic import AnsibleModule
67

78
import os

examples/cluster_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/python
22

33
from __future__ import print_function
4+
from __future__ import absolute_import
45
import argparse
56
import time
67
import logging

examples/coverage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/python
22

33
from __future__ import print_function
4+
from __future__ import absolute_import
45
from openshift import *
56

67
try:

examples/dump.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22

3+
from __future__ import absolute_import
34
import openshift as oc
45

56
if __name__ == '__main__':

examples/report.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22

3+
from __future__ import absolute_import
34
import openshift as oc
45

56
if __name__ == '__main__':

examples/simple.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22

33
from __future__ import print_function
4+
from __future__ import absolute_import
45
import openshift as oc
56

67
if __name__ == '__main__':

lambda/model/python/model.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from __future__ import absolute_import
2+
import six
3+
from six.moves import range
14

25

36
class OpenShiftPythonException(Exception):
@@ -116,16 +119,16 @@ def _element_can_match( master, test, case_insensitive=False):
116119
return master is test
117120

118121
if isinstance(master, str):
119-
master = unicode(master) # Turn str into unicode
122+
master = six.text_type(master) # Turn str into unicode
120123
if case_insensitive:
121124
master = master.lower()
122125

123126
if isinstance(test, str):
124-
test = unicode(test) # Turn str into unicode
127+
test = six.text_type(test) # Turn str into unicode
125128
if case_insensitive:
126129
test = test.lower()
127130

128-
for prim in [bool, int, unicode, float]:
131+
for prim in [bool, int, six.text_type, float]:
129132
if isinstance(master, prim):
130133
return master == test or str(master) == str(test)
131134

@@ -240,7 +243,7 @@ def __init__(self, dict_to_model=None, case_insensitive=False):
240243

241244
def __getattr__(self, attr):
242245

243-
if isinstance(attr, basestring):
246+
if isinstance(attr, six.string_types):
244247
if attr.startswith('_Model__'): # e.g. _Model__case_insensitive
245248
raise AttributeError
246249

@@ -283,7 +286,7 @@ def _primitive(self):
283286
:rtype: dict
284287
"""
285288
d = {}
286-
for k, v in self.iteritems():
289+
for k, v in six.iteritems(self):
287290
if isinstance(v, Model) or isinstance(v, ListModel):
288291
v = v._primitive()
289292
d[k] = v

packages/monitoring.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/python
22

33
from __future__ import print_function
4+
from __future__ import absolute_import
45
import openshift as oc
56
from openshift import Missing
67
import traceback

0 commit comments

Comments
 (0)