示例#1
0
文件: qm.py 项目: GLab/ToMaTo
def _check():
	QMError.check(os.path.exists("/dev/kvm"), QMError.CODE_UNSUPPORTED, "No KVM support on host")
	QMError.check(os.access("/dev/kvm", os.W_OK), QMError.CODE_UNSUPPORTED, "No permission to use KVM")
	QMError.check(os.geteuid() == 0, QMError.CODE_UNSUPPORTED, "Not running as root")
	QMError.check(cmd.exists("qm"), QMError.CODE_UNSUPPORTED, "Binary qm does not exist")
	QMError.check(cmd.exists("socat"), QMError.CODE_UNSUPPORTED, "Binary socat does not exist")
	dpkg.checkSupport()
	QMError.check(dpkg.isInstalled("pve-qemu-kvm"), QMError.CODE_UNSUPPORTED, "Package pve-qemu-kvm not installed")
	global qmVersion
	qmVersion = dpkg.getVersion("pve-qemu-kvm")
	QMError.check(([0, 15, 0] <= qmVersion < [2, 3]), QMError.CODE_UNSUPPORTED, "Unsupported version of pve-qemu-kvm", {"version": qmVersion})
	brctl.checkSupport()
	return True
示例#2
0
def _check():
    QMError.check(os.path.exists("/dev/kvm"), QMError.CODE_UNSUPPORTED,
                  "No KVM support on host")
    QMError.check(os.access("/dev/kvm", os.W_OK), QMError.CODE_UNSUPPORTED,
                  "No permission to use KVM")
    QMError.check(os.geteuid() == 0, QMError.CODE_UNSUPPORTED,
                  "Not running as root")
    QMError.check(cmd.exists("qm"), QMError.CODE_UNSUPPORTED,
                  "Binary qm does not exist")
    QMError.check(cmd.exists("socat"), QMError.CODE_UNSUPPORTED,
                  "Binary socat does not exist")
    dpkg.checkSupport()
    QMError.check(dpkg.isInstalled("pve-qemu-kvm"), QMError.CODE_UNSUPPORTED,
                  "Package pve-qemu-kvm not installed")
    global qmVersion
    qmVersion = dpkg.getVersion("pve-qemu-kvm")
    QMError.check(([0, 15, 0] <= qmVersion < [2, 3]), QMError.CODE_UNSUPPORTED,
                  "Unsupported version of pve-qemu-kvm",
                  {"version": qmVersion})
    brctl.checkSupport()
    return True
示例#3
0
def _check():
    QemuImgError.check(cmd.exists("qemu-img"), QemuImgError.CODE_UNSUPPORTED,
                       "Binary qemu-img does not exist")
    return True
示例#4
0
文件: tcpserver.py 项目: GLab/ToMaTo
def _check():
	TcpserverError.check(cmd.exists("tcpserver"), TcpserverError.CODE_UNSUPPORTED, "Binary tcpserver does not exist")
	return True
示例#5
0
def isSupported():
    return cmd.exists("busybox")
示例#6
0
def _check():
    VFatError.check(cmd.exists("mkfs.vfat"), VFatError.CODE_UNSUPPORTED,
                    "Binary mkfs.vfat does not exist")
    return True
示例#7
0
文件: vfat.py 项目: kesara10/ToMaTo
def _check():
    for binary in ['mkfs.vfat', 'sfdisk', 'dd', 'losetup', 'partx']:
        ImageError.check(cmd.exists(binary), ImageError.CODE_UNSUPPORTED,
                         "Binary %s does not exist" % binary)
    return True
示例#8
0
文件: aria2.py 项目: plaljx/ToMaTo
def isSupported():
	return cmd.exists("aria2c")
示例#9
0
def _check():
    BrctlError.check(os.geteuid() == 0, BrctlError.CODE_UNSUPPORTED,
                     "Not running as root")
    BrctlError.check(cmd.exists("brctl"), BrctlError.CODE_UNSUPPORTED,
                     "Binary brctl does not exist")
    return True
示例#10
0
文件: brctl.py 项目: GLab/ToMaTo
def _check():
	BrctlError.check(os.geteuid() == 0, BrctlError.CODE_UNSUPPORTED, "Not running as root")
	BrctlError.check(cmd.exists("brctl"), BrctlError.CODE_UNSUPPORTED, "Binary brctl does not exist")
	return True
示例#11
0
def _check():
    IpspyError.check(cmd.exists("ipspy"), IpspyError.CODE_UNSUPPORTED,
                     "Binary ipspy does not exist")
    return True
示例#12
0
def _check():
    WebsockifyError.check(cmd.exists("websockify"),
                          WebsockifyError.CODE_UNSUPPORTED,
                          "Binary websockify does not exist")
    return True
示例#13
0
文件: websockify.py 项目: GLab/ToMaTo
def _check():
	WebsockifyError.check(cmd.exists("websockify"), WebsockifyError.CODE_UNSUPPORTED, "Binary websockify does not exist")
	return True
示例#14
0
def _check():
    DpkgError.check(cmd.exists("dpkg-query"), DpkgError.CODE_UNSUPPORTED,
                    "Binary dpkg-query does not exist")
    return True
示例#15
0
文件: dpkg.py 项目: GLab/ToMaTo
def _check():
	DpkgError.check(cmd.exists("dpkg-query"), DpkgError.CODE_UNSUPPORTED, "Binary dpkg-query does not exist")
	return True
示例#16
0
def _check():
    NetstatError.check(cmd.exists("netstat"), NetstatError.CODE_UNSUPPORTED,
                       "Binary netstat does not exist")
    return True
示例#17
0
文件: netstat.py 项目: GLab/ToMaTo
def _check():
	NetstatError.check(cmd.exists("netstat"), NetstatError.CODE_UNSUPPORTED, "Binary netstat does not exist")
	return True
示例#18
0
文件: qemu_img.py 项目: GLab/ToMaTo
def _check():
	QemuImgError.check(cmd.exists("qemu-img"), QemuImgError.CODE_UNSUPPORTED, "Binary qemu-img does not exist")
	return True
示例#19
0
文件: ipspy.py 项目: GLab/ToMaTo
def _check():
    IpspyError.check(cmd.exists("ipspy"), IpspyError.CODE_UNSUPPORTED, "Binary ipspy does not exist")
    return True
示例#20
0
def isSupported():
	return cmd.exists("vpncloud")
示例#21
0
文件: vfat.py 项目: GLab/ToMaTo
def _check():
	for binary in ['mkfs.vfat', 'sfdisk', 'dd', 'losetup', 'partx']:
		ImageError.check(cmd.exists(binary), ImageError.CODE_UNSUPPORTED, "Binary %s does not exist" % binary)
	return True
示例#22
0
文件: busybox.py 项目: GLab/ToMaTo
def isSupported():
	return cmd.exists("busybox")
示例#23
0
def _check():
    TcpserverError.check(cmd.exists("tcpserver"),
                         TcpserverError.CODE_UNSUPPORTED,
                         "Binary tcpserver does not exist")
    return True