mirror of
				https://github.com/ansible-collections/community.general.git
				synced 2025-10-25 05:23:58 -07:00 
			
		
		
		
	Fix Python 2 compatibility issue. (#2340)
This commit is contained in:
		
					parent
					
						
							
								8ddb81a36f
							
						
					
				
			
			
				commit
				
					
						5195536bd8
					
				
			
		
					 2 changed files with 4 additions and 1 deletions
				
			
		
							
								
								
									
										2
									
								
								changelogs/fragments/2340-jenkins_plugin-py2.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								changelogs/fragments/2340-jenkins_plugin-py2.yml
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,2 @@ | ||||||
|  | bugfixes: | ||||||
|  | - "jenkins_plugin - fixes Python 2 compatibility issue (https://github.com/ansible-collections/community.general/pull/2340)." | ||||||
|  | @ -276,6 +276,7 @@ from ansible.module_utils.six import text_type, binary_type | ||||||
| from ansible.module_utils._text import to_native | from ansible.module_utils._text import to_native | ||||||
| import base64 | import base64 | ||||||
| import hashlib | import hashlib | ||||||
|  | import io | ||||||
| import json | import json | ||||||
| import os | import os | ||||||
| import tempfile | import tempfile | ||||||
|  | @ -560,7 +561,7 @@ class JenkinsPlugin(object): | ||||||
| 
 | 
 | ||||||
|         # Open the updates file |         # Open the updates file | ||||||
|         try: |         try: | ||||||
|             f = open(updates_file, encoding='utf-8') |             f = io.open(updates_file, encoding='utf-8') | ||||||
|         except IOError as e: |         except IOError as e: | ||||||
|             self.module.fail_json( |             self.module.fail_json( | ||||||
|                 msg="Cannot open temporal updates file.", |                 msg="Cannot open temporal updates file.", | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue