Python wrapper for running instances of trisurf-ng
Samo Penic
2017-01-08 6f912faddf8810d6849af46fcf66c0ed52fb324c
Added originating-host flag
1 files modified
3 ■■■■ changed files
trisurf/tsmgr.py 3 ●●●● patch | view | raw | blame | history
trisurf/tsmgr.py
@@ -55,6 +55,7 @@
    parser.add_argument('-n', nargs='+', metavar='PROC_NO', type=int, help='OBSOLETE. Specifies process numbers.')
    parser.add_argument('-R','--raw',help='print status and the rest of the information in raw format', action="store_true")
    parser.add_argument('-x','--local-only',help='do not attempt to contact remote hosts. Run all operations only on local machine',action='store_true')
    parser.add_argument('--originating-host',nargs=1,help='specify which host started the remote connections. Useful mainly fo internal functionaly of tsmgr and analyses.')
    args = parser.parse_args(arguments)
    return args
@@ -309,7 +310,7 @@
            #print(remote_dir)
            #print(main.__file__)
            #print('python3 '+main.__file__+' -x '+" ".join(argv))
            output=host['_conn'].execute('cd '+remote_dir+ '; python3 '+main.__file__+' -x '+" ".join(argv))
            output=host['_conn'].execute('cd '+remote_dir+ '; python3 '+main.__file__+' -x --originating-host ' +socket.gethostname()+" ".join(argv))
            for line in output:
                print(line.replace('\n',''))