forked from ungleich-public/cdist
		
	Merge pull request #513 from darko-poljak/fix-manifest-stdout
Fix manifest output
This commit is contained in:
		
				commit
				
					
						8bd2ea47cc
					
				
			
		
					 2 changed files with 7 additions and 5 deletions
				
			
		| 
						 | 
					@ -138,7 +138,8 @@ class Manifest(object):
 | 
				
			||||||
        message_prefix = "initialmanifest"
 | 
					        message_prefix = "initialmanifest"
 | 
				
			||||||
        self.local.run_script(initial_manifest,
 | 
					        self.local.run_script(initial_manifest,
 | 
				
			||||||
                              env=self.env_initial_manifest(initial_manifest),
 | 
					                              env=self.env_initial_manifest(initial_manifest),
 | 
				
			||||||
                              message_prefix=message_prefix)
 | 
					                              message_prefix=message_prefix,
 | 
				
			||||||
 | 
					                              save_output=False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def env_type_manifest(self, cdist_object):
 | 
					    def env_type_manifest(self, cdist_object):
 | 
				
			||||||
        type_manifest = os.path.join(self.local.type_path,
 | 
					        type_manifest = os.path.join(self.local.type_path,
 | 
				
			||||||
| 
						 | 
					@ -163,4 +164,5 @@ class Manifest(object):
 | 
				
			||||||
        if os.path.isfile(type_manifest):
 | 
					        if os.path.isfile(type_manifest):
 | 
				
			||||||
            self.local.run_script(type_manifest,
 | 
					            self.local.run_script(type_manifest,
 | 
				
			||||||
                                  env=self.env_type_manifest(cdist_object),
 | 
					                                  env=self.env_type_manifest(cdist_object),
 | 
				
			||||||
                                  message_prefix=message_prefix)
 | 
					                                  message_prefix=message_prefix,
 | 
				
			||||||
 | 
					                                  save_output=False)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -212,7 +212,7 @@ class Local(object):
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            if save_output:
 | 
					            if save_output:
 | 
				
			||||||
                output, errout = exec_util.call_get_output(command, env=env)
 | 
					                output, errout = exec_util.call_get_output(command, env=env)
 | 
				
			||||||
                self.log.debug("Local stdout: {}".format(output))
 | 
					                self.log.info("Local stdout: {}".format(output))
 | 
				
			||||||
                # Currently, stderr is not captured.
 | 
					                # Currently, stderr is not captured.
 | 
				
			||||||
                # self.log.debug("Local stderr: {}".format(errout))
 | 
					                # self.log.debug("Local stderr: {}".format(errout))
 | 
				
			||||||
                if return_output:
 | 
					                if return_output:
 | 
				
			||||||
| 
						 | 
					@ -231,7 +231,7 @@ class Local(object):
 | 
				
			||||||
                message.merge_messages()
 | 
					                message.merge_messages()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def run_script(self, script, env=None, return_output=False,
 | 
					    def run_script(self, script, env=None, return_output=False,
 | 
				
			||||||
                   message_prefix=None):
 | 
					                   message_prefix=None, save_output=True):
 | 
				
			||||||
        """Run the given script with the given environment.
 | 
					        """Run the given script with the given environment.
 | 
				
			||||||
        Return the output as a string.
 | 
					        Return the output as a string.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -240,7 +240,7 @@ class Local(object):
 | 
				
			||||||
        command.append(script)
 | 
					        command.append(script)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return self.run(command=command, env=env, return_output=return_output,
 | 
					        return self.run(command=command, env=env, return_output=return_output,
 | 
				
			||||||
                        message_prefix=message_prefix)
 | 
					                        message_prefix=message_prefix, save_output=save_output)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def save_cache(self):
 | 
					    def save_cache(self):
 | 
				
			||||||
        destination = os.path.join(self.cache_path, self.hostdir)
 | 
					        destination = os.path.join(self.cache_path, self.hostdir)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue