mirror of
				https://github.com/Rudd-O/ansible-qubes.git
				synced 2025-10-31 03:28:56 +01:00 
			
		
		
		
	Various fixes.
This commit is contained in:
		
							parent
							
								
									eb8d0ab162
								
							
						
					
					
						commit
						88907adabb
					
				| @ -88,7 +88,7 @@ class LoggingEmu(): | ||||
|                 string = a[0] | ||||
|             else: | ||||
|                 string = a[0] % a[1:] | ||||
|             syslog.syslog(prio, ("%.3f  " % deltat) +  string) | ||||
|             syslog.syslog(prio, ("%.3f  " % deltat) + threading.currentThread().getName() + ": " + string) | ||||
|         finally: | ||||
|             debug_lock.release() | ||||
| logging = None | ||||
|  | ||||
| @ -129,30 +129,31 @@ def popen(cmd, in_data, outf=sys.stdout): | ||||
| def put(out_path): | ||||
|     try: | ||||
|         f = open(out_path, "wb") | ||||
|         sys.stdout.write('{}\n'.format('Y').encode('ascii')) | ||||
|         sys.stdout.write(b'Y\n') | ||||
|     except (IOError, OSError) as e: | ||||
|         sys.stdout.write('{}\n'.format('N').encode('ascii')) | ||||
|         sys.stdout.write(b'N\n') | ||||
|         encode_exception(e, sys.stdout) | ||||
|         return | ||||
|     try: | ||||
|     while True: | ||||
|             chunksize = int(sys.stdin.readline(16).decode('ascii')) | ||||
|         chunksize = int(sys.stdin.readline(16)) | ||||
|         if chunksize == 0: | ||||
|             break | ||||
|         chunk = sys.stdin.read(chunksize) | ||||
|         try: | ||||
|             f.write(chunk) | ||||
|                 sys.stdout.write('{}\n'.format('Y').encode('ascii')) | ||||
|             sys.stdout.write(b'Y\n') | ||||
|         except (IOError, OSError) as e: | ||||
|                 sys.stdout.write('{}\n'.format('N').encode('ascii')) | ||||
|             sys.stdout.write(b'N\n') | ||||
|             encode_exception(e, sys.stdout) | ||||
|             f.close() | ||||
|             return | ||||
|     try: | ||||
|         f.flush() | ||||
|     except (IOError, OSError) as e: | ||||
|             sys.stdout.write('{}\n'.format('N').encode('ascii')) | ||||
|         sys.stdout.write(b'N\n') | ||||
|         encode_exception(e, sys.stdout) | ||||
|     finally: | ||||
|         f.close() | ||||
|         return | ||||
|     f.close() | ||||
| 
 | ||||
| 
 | ||||
| @ -160,7 +161,7 @@ def fetch(in_path, bufsize): | ||||
|     try: | ||||
|         f = open(in_path, "rb") | ||||
|     except (IOError, OSError) as e: | ||||
|         sys.stdout.write('{}\n'.format('N').encode('ascii')) | ||||
|         sys.stdout.write(b'N\n') | ||||
|         encode_exception(e, sys.stdout) | ||||
|         return | ||||
|     try: | ||||
| @ -168,8 +169,9 @@ def fetch(in_path, bufsize): | ||||
|             try: | ||||
|                 data = f.read(bufsize) | ||||
|             except (IOError, OSError) as e: | ||||
|                 sys.stdout.write('{}\n'.format('N').encode('ascii')) | ||||
|                 sys.stdout.write(b'N\n') | ||||
|                 encode_exception(e, sys.stdout) | ||||
|                 f.close() | ||||
|                 return | ||||
|             sys.stdout.write('{}\n'.format(len(data)).encode('ascii')) | ||||
|             if len(data) == 0: | ||||
| @ -177,7 +179,6 @@ def fetch(in_path, bufsize): | ||||
|                 break | ||||
|             sys.stdout.write(data) | ||||
|             sys.stdout.flush() | ||||
|     finally: | ||||
|     f.close() | ||||
| 
 | ||||
| 
 | ||||
| @ -263,11 +264,11 @@ class Connection(ConnectionBase): | ||||
|             self.transport_cmd = kwargs['transport_cmd'] | ||||
|             return | ||||
|         self.transport_cmd = distutils.spawn.find_executable('qrun') | ||||
|         self.transport_cmd = None | ||||
|         if not self.transport_cmd: | ||||
|             self.transport_cmd = os.path.join( | ||||
|                 os.path.dirname(__file__), | ||||
|                 os.path.pardir, | ||||
|                 os.path.pardir, | ||||
|                 "bin", | ||||
|                 "qrun", | ||||
|             ) | ||||
| @ -296,7 +297,7 @@ class Connection(ConnectionBase): | ||||
|         if not self._connected: | ||||
|             remote_cmd = [to_bytes(x, errors='surrogate_or_strict') for x in [ | ||||
|                 # 'strace', '-s', '2048', '-o', '/tmp/log', | ||||
|                  'python', '-i', '-c', preamble | ||||
|                  'python', '-u', '-i', '-c', preamble | ||||
|             ]] | ||||
|             addr = self._play_context.remote_addr | ||||
|             proxy = to_bytes(self.get_option("management_proxy")) if self.get_option("management_proxy") else "" | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Rudd-O
						Rudd-O