mirror of
				https://github.com/Rudd-O/ansible-qubes.git
				synced 2025-10-31 03:28:56 +01:00 
			
		
		
		
	Nicely ellipsize logged commands.
This commit is contained in:
		
							parent
							
								
									782c557cb6
								
							
						
					
					
						commit
						c85b35867d
					
				| @ -3,7 +3,7 @@ | ||||
| %define mybuildnumber %{?build_number}%{?!build_number:1} | ||||
| 
 | ||||
| Name:           ansible-qubes | ||||
| Version:        0.0.17 | ||||
| Version:        0.0.18 | ||||
| Release:        %{mybuildnumber}%{?dist} | ||||
| Summary:        Inter-VM program execution for Qubes OS AppVMs and StandaloneVMs | ||||
| BuildArch:      noarch | ||||
|  | ||||
| @ -321,12 +321,18 @@ def quotedargs(): | ||||
|     return " ".join(quote(x) for x in sys.argv[1:]) | ||||
| 
 | ||||
| 
 | ||||
| def quotedargs_ellipsized(cmdlist): | ||||
|     text = " ".join(quote(x for x in sys.argv[1:])) | ||||
|     if len(text) > 80: | ||||
|         text = text[:77] + "..." | ||||
|     return text | ||||
| 
 | ||||
| def main_master(): | ||||
|     set_proc_name("bombshell-client (master) %s" % quotedargs()) | ||||
|     global logging | ||||
|     logging = LoggingEmu("master") | ||||
| 
 | ||||
|     logging.info("Started with arguments: %s", sys.argv[1:]) | ||||
|     logging.info("Started with arguments: %s", quotedargs_ellipsized(sys.argv[1:])) | ||||
| 
 | ||||
|     global debug_enabled | ||||
|     args = sys.argv[1:] | ||||
| @ -419,7 +425,7 @@ def main_remote(): | ||||
|     global logging | ||||
|     logging = LoggingEmu("remote") | ||||
| 
 | ||||
|     logging.info("Started with arguments: %s", sys.argv[1:]) | ||||
|     logging.info("Started with arguments: %s", quotedargs_ellipsized(sys.argv[1:])) | ||||
| 
 | ||||
|     global debug_enabled | ||||
|     if "-d" in sys.argv[1:]: | ||||
| @ -468,10 +474,11 @@ def main_remote(): | ||||
|     muxer.name = "remote multiplexer" | ||||
|     muxer.start() | ||||
| 
 | ||||
|     logging.info("Started %s", nicecmd) | ||||
|     nicecmd_ellipsized = quotedargs_ellipsized(cmd) | ||||
|     logging.info("Started %s", nicecmd_ellipsized) | ||||
| 
 | ||||
|     retval = p.wait() | ||||
|     logging.info("Return code %s for %s", retval, nicecmd) | ||||
|     logging.info("Return code %s for %s", retval, nicecmd_ellipsized) | ||||
|     muxer.join() | ||||
|     logging.info("Ending bombshell") | ||||
|     return retval | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Manuel Amador (Rudd-O)
						Manuel Amador (Rudd-O)