Commit e39ee5fe authored by Matthias Braun's avatar Matthias Braun
Browse files

write config to stdout in generate config mode

parent 6b6bcbba
...@@ -5,6 +5,7 @@ import optparse # TODO argparse from python 2.7 on ...@@ -5,6 +5,7 @@ import optparse # TODO argparse from python 2.7 on
import subprocess import subprocess
import resource import resource
import socket import socket
import sys
from datetime import datetime from datetime import datetime
SCRIPT_VERSION="0.1" SCRIPT_VERSION="0.1"
...@@ -447,11 +448,13 @@ if __name__ == "__main__": ...@@ -447,11 +448,13 @@ if __name__ == "__main__":
check_options(options) check_options(options)
progs = [prog for prog in filter_progs(options, args)] progs = [prog for prog in filter_progs(options, args)]
conf = generate_spec_config(options, progs) conf = generate_spec_config(options, progs)
fh = open("config/generated.cfg", 'w')
fh.write(conf)
fh.close()
if options.config_only: if options.config_only:
sys.stdout.write(conf)
exit(0) exit(0)
else:
fh = open("config/generated.cfg", 'w')
fh.write(conf)
fh.close()
strprogs = " ".join(progs) strprogs = " ".join(progs)
cmd = "env bash -l -c 'source shrc && runspec %s -c generated'" % strprogs cmd = "env bash -l -c 'source shrc && runspec %s -c generated'" % strprogs
exit(os.system(cmd)) exit(os.system(cmd))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment