def stop_xend(tui):
	need_to_reboot = False

	print >>sys.stderr, "Permanently stopping xend"
	distro = platform.dist()[0].lower()
	if distro in ["fedora", "redhat", "centos"]:
		if subprocess.call(["chkconfig", "--level", "345", "xend", "off"]) <> 0:
			print >>sys.stderr, "FAILED: to disable xend"
	elif distro in ["ubuntu", "debian"]:
		r = toolstack.analyse(tui)
		if r:
			need_to_reboot = True
			for change in r:
				replace.file(change[0], change[1])
	else: 
		print >>sys.stderr, "FAILED: don't know how to disable xend"
	if subprocess.call(["service", "xend", "stop"]) <> 0:
		print >>sys.stderr, "FAILED: to stop xend"
	return need_to_reboot
def stop_xend(tui):
	need_to_reboot = False

	print >>sys.stderr, "Permanently stopping xend"
	try:
		if subprocess.call(["chkconfig", "xend"]) <> 0:
			if subprocess.call(["chkconfig", "--level", "345", "xend", "off"]) <> 0:
				print >>sys.stderr, "FAILED: to disable xend"
	except:
		pass # no chkconfig on Debian/Ubuntu
	if os.path.exists(toolstack.etc_default_xen):
		r = toolstack.analyse(tui)
		if r:
			need_to_reboot = True
			for change in r:
				replace.file(change[0], change[1])
	if subprocess.call(["service", "xend", "stop"]) <> 0:
		print >>sys.stderr, "FAILED: to stop xend"
	return need_to_reboot
示例#3
0
def stop_xend(tui):
    need_to_reboot = False

    print >> sys.stderr, "Permanently stopping xend"
    try:
        if subprocess.call(["chkconfig", "xend"]) <> 0:
            if subprocess.call(["chkconfig", "--level", "345", "xend", "off"
                                ]) <> 0:
                print >> sys.stderr, "FAILED: to disable xend"
    except:
        pass  # no chkconfig on Debian/Ubuntu
    if os.path.exists(toolstack.etc_default_xen):
        r = toolstack.analyse(tui)
        if r:
            need_to_reboot = True
            for change in r:
                replace.file(change[0], change[1])
    if subprocess.call(["service", "xend", "stop"]) <> 0:
        print >> sys.stderr, "FAILED: to stop xend"
    return need_to_reboot