-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (25 loc) · 669 Bytes
/
main.py
File metadata and controls
31 lines (25 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from sys import exit
from cli import getCli
from command_file import getCommands
from runner import Runner
from utils import Log
def main(args):
log = Log(not args.noColour)
runner = Runner(
args.timeout,
log,
hostNames=args.hostNames,
hostFile=args.hostFile,
quiet=args.quiet,
only=args.only)
if args.command:
runner.runCommand(args.command, args.sudo)
elif args.commandFile:
commands = getCommands(args.commandFile)
runner.runCommandList(commands)
runner.close()
exit()
if __name__ == '__main__':
parser = getCli()
args = parser.parse_args()
main(args)