forked from ungleich-public/cdist
		
	split deploy to into two stages
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								7c56630924
							
						
					
				
			
			
				commit
				
					
						b2546fb236
					
				
			
		
					 1 changed files with 14 additions and 6 deletions
				
			
		
							
								
								
									
										18
									
								
								bin/cdist
									
										
									
									
									
								
							
							
						
						
									
										18
									
								
								bin/cdist
									
										
									
									
									
								
							| 
						 | 
					@ -555,10 +555,8 @@ class Cdist:
 | 
				
			||||||
            self.transfer_file(local_remote_code, remote_remote_code)
 | 
					            self.transfer_file(local_remote_code, remote_remote_code)
 | 
				
			||||||
            self.run_or_fail([remote_remote_code], remote=True)
 | 
					            self.run_or_fail([remote_remote_code], remote=True)
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
   def deploy_to(self):
 | 
					   def stage_prepare(self):
 | 
				
			||||||
      """Mimic the old deploy to: Deploy to one host"""
 | 
					      """Do everything for a deploy, minus the actual code stage"""
 | 
				
			||||||
      log.info("Deploying to " + self.target_host)
 | 
					 | 
				
			||||||
      time_start = datetime.datetime.now()
 | 
					 | 
				
			||||||
      self.init_deploy()
 | 
					      self.init_deploy()
 | 
				
			||||||
      self.run_global_explores()
 | 
					      self.run_global_explores()
 | 
				
			||||||
      self.run_initial_manifest()
 | 
					      self.run_initial_manifest()
 | 
				
			||||||
| 
						 | 
					@ -581,13 +579,23 @@ class Cdist:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
         objects = self.list_objects()
 | 
					         objects = self.list_objects()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   def stage_run(self):
 | 
				
			||||||
 | 
					      """The final (and real) step of deployment"""
 | 
				
			||||||
      log.debug("Actual run objects")
 | 
					      log.debug("Actual run objects")
 | 
				
			||||||
      # Now do the final steps over the existing objects
 | 
					      # Now do the final steps over the existing objects
 | 
				
			||||||
      for cdist_object in objects:
 | 
					      for cdist_object in self.list_objects():
 | 
				
			||||||
         log.debug("Run object: %s", cdist_object)
 | 
					         log.debug("Run object: %s", cdist_object)
 | 
				
			||||||
         self.object_run(cdist_object, mode="gencode")
 | 
					         self.object_run(cdist_object, mode="gencode")
 | 
				
			||||||
         self.object_run(cdist_object, mode="code")
 | 
					         self.object_run(cdist_object, mode="code")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   def deploy_to(self):
 | 
				
			||||||
 | 
					      """Mimic the old deploy to: Deploy to one host"""
 | 
				
			||||||
 | 
					      log.info("Deploying to " + self.target_host)
 | 
				
			||||||
 | 
					      time_start = datetime.datetime.now()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      self.stage_prepare()
 | 
				
			||||||
 | 
					      self.stage_run()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      time_end = datetime.datetime.now()
 | 
					      time_end = datetime.datetime.now()
 | 
				
			||||||
      duration = time_end - time_start
 | 
					      duration = time_end - time_start
 | 
				
			||||||
      log.info("Finished run of %s in %s seconds", 
 | 
					      log.info("Finished run of %s in %s seconds", 
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue