浏览代码

Fixing file write issue.

Kenny Woodson 7 年之前
父节点
当前提交
c78f9763e1
共有 30 个文件被更改,包括 30 次插入30 次删除
  1. 1 1
      roles/lib_openshift/library/oc_adm_ca_server_cert.py
  2. 1 1
      roles/lib_openshift/library/oc_adm_csr.py
  3. 1 1
      roles/lib_openshift/library/oc_adm_manage_node.py
  4. 1 1
      roles/lib_openshift/library/oc_adm_policy_group.py
  5. 1 1
      roles/lib_openshift/library/oc_adm_policy_user.py
  6. 1 1
      roles/lib_openshift/library/oc_adm_registry.py
  7. 1 1
      roles/lib_openshift/library/oc_adm_router.py
  8. 1 1
      roles/lib_openshift/library/oc_clusterrole.py
  9. 1 1
      roles/lib_openshift/library/oc_configmap.py
  10. 1 1
      roles/lib_openshift/library/oc_edit.py
  11. 1 1
      roles/lib_openshift/library/oc_env.py
  12. 1 1
      roles/lib_openshift/library/oc_group.py
  13. 1 1
      roles/lib_openshift/library/oc_image.py
  14. 1 1
      roles/lib_openshift/library/oc_label.py
  15. 1 1
      roles/lib_openshift/library/oc_obj.py
  16. 1 1
      roles/lib_openshift/library/oc_objectvalidator.py
  17. 1 1
      roles/lib_openshift/library/oc_process.py
  18. 1 1
      roles/lib_openshift/library/oc_project.py
  19. 1 1
      roles/lib_openshift/library/oc_pvc.py
  20. 1 1
      roles/lib_openshift/library/oc_route.py
  21. 1 1
      roles/lib_openshift/library/oc_scale.py
  22. 1 1
      roles/lib_openshift/library/oc_secret.py
  23. 1 1
      roles/lib_openshift/library/oc_service.py
  24. 1 1
      roles/lib_openshift/library/oc_serviceaccount.py
  25. 1 1
      roles/lib_openshift/library/oc_serviceaccount_secret.py
  26. 1 1
      roles/lib_openshift/library/oc_storageclass.py
  27. 1 1
      roles/lib_openshift/library/oc_user.py
  28. 1 1
      roles/lib_openshift/library/oc_version.py
  29. 1 1
      roles/lib_openshift/library/oc_volume.py
  30. 1 1
      roles/lib_openshift/src/lib/base.py

+ 1 - 1
roles/lib_openshift/library/oc_adm_ca_server_cert.py

@@ -1138,7 +1138,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_adm_csr.py

@@ -1116,7 +1116,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_adm_manage_node.py

@@ -1124,7 +1124,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_adm_policy_group.py

@@ -1110,7 +1110,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_adm_policy_user.py

@@ -1124,7 +1124,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_adm_registry.py

@@ -1228,7 +1228,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_adm_router.py

@@ -1253,7 +1253,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_clusterrole.py

@@ -1102,7 +1102,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_configmap.py

@@ -1108,7 +1108,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_edit.py

@@ -1152,7 +1152,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_env.py

@@ -1119,7 +1119,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_group.py

@@ -1092,7 +1092,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_image.py

@@ -1111,7 +1111,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_label.py

@@ -1128,7 +1128,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_obj.py

@@ -1131,7 +1131,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_objectvalidator.py

@@ -1063,7 +1063,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_process.py

@@ -1120,7 +1120,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_project.py

@@ -1117,7 +1117,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_pvc.py

@@ -1124,7 +1124,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_route.py

@@ -1168,7 +1168,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_scale.py

@@ -1106,7 +1106,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_secret.py

@@ -1164,7 +1164,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_service.py

@@ -1171,7 +1171,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_serviceaccount.py

@@ -1104,7 +1104,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_serviceaccount_secret.py

@@ -1104,7 +1104,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_storageclass.py

@@ -1122,7 +1122,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_user.py

@@ -1164,7 +1164,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_version.py

@@ -1076,7 +1076,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/library/oc_volume.py

@@ -1153,7 +1153,7 @@ class Utils(object):  # pragma: no cover
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):

+ 1 - 1
roles/lib_openshift/src/lib/base.py

@@ -314,7 +314,7 @@ class Utils(object):
         ''' Actually write the file contents to disk. This helps with mocking. '''
         ''' Actually write the file contents to disk. This helps with mocking. '''
 
 
         with open(filename, 'w') as sfd:
         with open(filename, 'w') as sfd:
-            sfd.write(contents)
+            sfd.write(str(contents))
 
 
     @staticmethod
     @staticmethod
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):
     def create_tmp_file_from_contents(rname, data, ftype='yaml'):