X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=getconf.py;h=ad8f9a7191bdc1654aa528c7858958b0e75cb1f9;hb=c9b6e5bc35cc3d64455d68583244fcaf17a8c83b;hp=205f0ffee9a8b8e66a2b3f2c0fdd479185cbc29a;hpb=c3f2afdc81c6711c3825c82e2cd4970671575438;p=monitor.git diff --git a/getconf.py b/getconf.py index 205f0ff..ad8f9a7 100755 --- a/getconf.py +++ b/getconf.py @@ -1,10 +1,11 @@ #!/usr/bin/python -import plc +from monitor.wrapper import plc +from monitor import config +import monitor.parser as parsermodule api = plc.getAuthAPI() import sys import os -import monitorconfig def getconf(hostname, force=False, media=None): n = api.GetNodes(hostname) @@ -14,30 +15,32 @@ def getconf(hostname, force=False, media=None): f.write( api.AdmGenerateNodeConfFile(n[0]['node_id']) ) f.close() print os.system("cd bootcd; ./build.sh -f %s.txt -t iso -o /plc/data/var/www/html/bootcds/%s.iso &> /dev/null" % ( hostname, hostname)) + print "cd bootcd; ./build.sh -f %s.txt -t usb_partition -o /plc/data/var/www/html/bootcds/%s-partition.usb &> /dev/null" % ( hostname, hostname) print os.system("cd bootcd; ./build.sh -f %s.txt -t usb_partition -o /plc/data/var/www/html/bootcds/%s-partition.usb &> /dev/null" % ( hostname, hostname)) else: + #print os.system("cd bootcd; ./build.sh -f %s.txt -t iso -o /plc/data/var/www/html/bootcds/%s.iso &> /dev/null" % ( hostname, hostname)) + print "cd bootcd; ./build.sh -f %s.txt -t usb_partition -o /plc/data/var/www/html/bootcds/%s-partition.usb &> /dev/null" % ( hostname, hostname) + #print os.system("cd bootcd; ./build.sh -f %s.txt -t usb_partition -o /plc/data/var/www/html/bootcds/%s-partition.usb &> /dev/null" % ( hostname, hostname)) # assume that the images have already been generated.. pass args = {} if not media: - args['url_list'] = " http://%s/bootcds/%s-partition.usb\n" % (monitorconfig.MONITOR_HOSTNAME, hostname) - args['url_list'] += " http://%s/bootcds/%s.iso" % (monitorconfig.MONITOR_HOSTNAME, hostname) + args['url_list'] = " http://%s/bootcds/%s-partition.usb\n" % (config.MONITOR_HOSTNAME, hostname) + args['url_list'] += " http://%s/bootcds/%s.iso" % (config.MONITOR_HOSTNAME, hostname) else: if media == "usb": - args['url_list'] = " http://%s/bootcds/%s-partition.usb\n" % (monitorconfig.MONITOR_HOSTNAME, hostname) + args['url_list'] = " http://%s/bootcds/%s-partition.usb\n" % (config.MONITOR_HOSTNAME, hostname) elif media == "iso": - args['url_list'] = " http://%s/bootcds/%s.iso" % (monitorconfig.MONITOR_HOSTNAME, hostname) + args['url_list'] = " http://%s/bootcds/%s.iso" % (config.MONITOR_HOSTNAME, hostname) else: - args['url_list'] = " http://%s/bootcds/%s-partition.usb\n" % (monitorconfig.MONITOR_HOSTNAME, hostname) - args['url_list'] += " http://%s/bootcds/%s.iso" % (monitorconfig.MONITOR_HOSTNAME, hostname) + args['url_list'] = " http://%s/bootcds/%s-partition.usb\n" % (config.MONITOR_HOSTNAME, hostname) + args['url_list'] += " http://%s/bootcds/%s.iso" % (config.MONITOR_HOSTNAME, hostname) return args if __name__ == '__main__': - import parser as parsermodule - parser = parsermodule.getParser() parser.set_defaults(media='both', force=False) parser.add_option("", "--media", dest="media", metavar="usb, iso, both", @@ -46,7 +49,7 @@ if __name__ == '__main__': help="""Force the recreation of the usb images.""") parser = parsermodule.getParser(['defaults'], parser) - config = parsesrmodule.parse_args(parser) + config = parsermodule.parse_args(parser) ret = {'url_list' : ''} for i in config.args: