output map for commands is added
This commit is contained in:
parent
4e0acd60aa
commit
b455d14421
2
nodes.py
2
nodes.py
@ -52,6 +52,7 @@ class Node(object):
|
|||||||
self.logsize = 0
|
self.logsize = 0
|
||||||
# include logs from the command 'find /var/log/ ...'
|
# include logs from the command 'find /var/log/ ...'
|
||||||
self.flogs = flogs
|
self.flogs = flogs
|
||||||
|
self.mapcmds = {}
|
||||||
|
|
||||||
def set_files(self, dirname, key, ds, version):
|
def set_files(self, dirname, key, ds, version):
|
||||||
files = []
|
files = []
|
||||||
@ -124,6 +125,7 @@ class Node(object):
|
|||||||
dfile = os.path.join(ddir, 'node-%s-%s-%s' %
|
dfile = os.path.join(ddir, 'node-%s-%s-%s' %
|
||||||
(self.node_id, self.ip, os.path.basename(f)))
|
(self.node_id, self.ip, os.path.basename(f)))
|
||||||
logging.info('outfile: %s' % dfile)
|
logging.info('outfile: %s' % dfile)
|
||||||
|
self.mapcmds[f] = dfile
|
||||||
try:
|
try:
|
||||||
with open(dfile, 'w') as df:
|
with open(dfile, 'w') as df:
|
||||||
df.write(outs)
|
df.write(outs)
|
||||||
|
@ -57,8 +57,11 @@ def main(argv=None):
|
|||||||
destdir=args.dest_file)
|
destdir=args.dest_file)
|
||||||
# nodes.print_nodes()
|
# nodes.print_nodes()
|
||||||
n.get_node_file_list()
|
n.get_node_file_list()
|
||||||
|
n.launch_ssh(conf['out-dir'])
|
||||||
n.print_nodes()
|
n.print_nodes()
|
||||||
n.get_release()
|
n.get_release()
|
||||||
|
for node in n.nodes.values():
|
||||||
|
logging.info('map: %s' %node.mapcmds)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user