remove useless try: block that was needed to find out how multiprocess /sigint behaviour works
NOT needed: KeyBoardInterrupet (aka SIGINT) is forwarded to processes spawned by multiprocess! Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								531ad2966f
							
						
					
				
			
			
				commit
				
					
						58a88ca5bd
					
				
			
		
					 1 changed files with 23 additions and 36 deletions
				
			
		
							
								
								
									
										13
									
								
								bin/cdist
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								bin/cdist
									
										
									
									
									
								
							| 
						 | 
					@ -115,7 +115,6 @@ def configinstall(args, mode):
 | 
				
			||||||
        import atexit
 | 
					        import atexit
 | 
				
			||||||
        atexit.register(lambda: os.remove(initial_manifest_temp_path))
 | 
					        atexit.register(lambda: os.remove(initial_manifest_temp_path))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    try:
 | 
					 | 
				
			||||||
    process = {}
 | 
					    process = {}
 | 
				
			||||||
    failed_hosts = []
 | 
					    failed_hosts = []
 | 
				
			||||||
    time_start = time.time()
 | 
					    time_start = time.time()
 | 
				
			||||||
| 
						 | 
					@ -146,18 +145,6 @@ def configinstall(args, mode):
 | 
				
			||||||
    log.info("Total processing time for %s host(s): %s", len(args.host),
 | 
					    log.info("Total processing time for %s host(s): %s", len(args.host),
 | 
				
			||||||
                (time_end - time_start))
 | 
					                (time_end - time_start))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    except KeyboardInterrupt:
 | 
					 | 
				
			||||||
        if args.parallel:
 | 
					 | 
				
			||||||
            for p in process.keys():
 | 
					 | 
				
			||||||
                # NOT needed: KeyBoardInterrupet (aka SIGINT)
 | 
					 | 
				
			||||||
                # is forwarded to processes spawned by multiprocess!
 | 
					 | 
				
			||||||
                # pid = process[p].pid.__str__()
 | 
					 | 
				
			||||||
                #log.warn("Terminating deploy " + p + " (" + pid + ")")
 | 
					 | 
				
			||||||
                # process[p].terminate()
 | 
					 | 
				
			||||||
                pass
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        sys.exit(0)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
def configinstall_onehost(host, args, mode, parallel):
 | 
					def configinstall_onehost(host, args, mode, parallel):
 | 
				
			||||||
    """Configure or install ONE remote system"""
 | 
					    """Configure or install ONE remote system"""
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue