improved logging: removed outputs of cmds

This commit is contained in:
adobdin 2016-08-09 08:16:09 +00:00
parent 8e411618ab
commit f4cba6c097
2 changed files with 5 additions and 8 deletions

View File

@ -236,12 +236,12 @@ class Node(object):
f = scr
else:
f = os.path.join(self.rqdir, Node.skey, scr)
self.logger.info('node:%s(%s), exec: %s' % (self.id, self.ip, f))
self.logger.debug('node:%s(%s), exec: %s' % (self.id, self.ip, f))
dfile = os.path.join(ddir, 'node-%s-%s-%s' %
(self.id, self.ip, os.path.basename(f)))
if self.outputs_timestamp:
dfile += self.outputs_timestamp_str
self.logger.info('outfile: %s' % dfile)
self.logger.debug('outfile: %s' % dfile)
mapscr[scr] = dfile
if not fake:
outs, errs, code = tools.ssh_node(ip=self.ip,
@ -614,7 +614,6 @@ class NodeManager(object):
try:
self.logger.info('using fuelclient to get nodes json')
self.nodes_json = self.fuelclient.get_request('nodes')
self.logger.debug(self.nodes_json)
return True
except Exception as e:
self.logger.warning(("NodeManager: can't "

View File

@ -204,7 +204,7 @@ def launch_cmd(cmd, timeout, input=None, ok_codes=None):
except:
pass
logger.info('launching cmd %s' % cmd)
logger.debug('cmd: %s' % cmd)
p = subprocess.Popen(cmd,
shell=True,
stdin=subprocess.PIPE,
@ -226,8 +226,7 @@ def launch_cmd(cmd, timeout, input=None, ok_codes=None):
logger.debug(('___command: %s\n'
'_exit_code: %s\n'
'_____stdin: %s\n'
'____stdout: %s\n'
'____stderr: %s') % (cmd, p.returncode, input, outs,
'____stderr: %s') % (cmd, p.returncode, input,
errs))
return outs, errs, p.returncode
@ -244,11 +243,10 @@ def ssh_node(ip, command='', ssh_opts=None, env_vars=None, timeout=15,
if type(env_vars) is list:
env_vars = ' '.join(env_vars)
if (ip in ['localhost', '127.0.0.1']) or ip.startswith('127.'):
logger.info("skip ssh")
logger.debug("skip ssh")
bstr = "%s timeout '%s' bash -c " % (
env_vars, timeout)
else:
logger.info("exec ssh")
bstr = "timeout '%s' ssh -t -T %s '%s' '%s' " % (
timeout, ssh_opts, ip, env_vars)
if filename is None: