def reboot():
	xapi.sync()
	print >>sys.stderr, "Triggering an immediate reboot"
	cmd = [ "/sbin/reboot" ]
	x = subprocess.call(cmd)
	if x <> 0:
		print >>sys.stderr, "FAILED: to trigger a reboot (%s)" % (" ".join(cmd))
	else:
		exit(0)
Exemplo n.º 2
0
def reboot():
    xapi.sync()
    print >> sys.stderr, "Triggering an immediate reboot"
    cmd = ["/sbin/reboot"]
    x = subprocess.call(cmd)
    if x <> 0:
        print >> sys.stderr, "FAILED: to trigger a reboot (%s)" % (
            " ".join(cmd))
    else:
        exit(0)
		if os.path.isfile("/etc/default/grub"):
                        grub2.update_grub_config()

	# To run the toolstack we need to reboot with Xen
	if need_to_reboot:
		reboot_before_continuing(args)

	xapi.start ()
        # If XAPI started then we don't need to reboot for any grub changes
	need_to_reboot = False

	r = network.analyse(tui)
	if r:
		need_to_reboot = True
		for change in r:
			replace.file(change[0], change[1])
	r = iptables.analyse(tui)
	if r:
		replace.file(r[0], r[1])
                iptables.restart()
	storage.analyse(tui)
	hostname.analyse(tui)
	templates.create()
	errata.analyse()
	xapi.sync()

	if need_to_reboot:
		reboot_before_continuing(args)

	print "Welcome to XenServer!"
Exemplo n.º 4
0
        if os.path.isfile("/etc/default/grub"):
            grub2.update_grub_config()

    # To run the toolstack we need to reboot with Xen
    if need_to_reboot:
        reboot_before_continuing(args)

    xapi.start()
    # If XAPI started then we don't need to reboot for any grub changes
    need_to_reboot = False

    r = network.analyse(tui)
    if r:
        need_to_reboot = True
        for change in r:
            replace.file(change[0], change[1])
    r = iptables.analyse(tui)
    if r:
        replace.file(r[0], r[1])
        iptables.restart()
    storage.analyse(tui)
    hostname.analyse(tui)
    templates.create()
    errata.analyse()
    xapi.sync()

    if need_to_reboot:
        reboot_before_continuing(args)

    print "Welcome to XenServer!"