Example #1
0
File: qm.py Project: 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
Example #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
Example #3
0
def _check():
    QemuImgError.check(cmd.exists("qemu-img"), QemuImgError.CODE_UNSUPPORTED,
                       "Binary qemu-img does not exist")
    return True
Example #4
0
def _check():
	TcpserverError.check(cmd.exists("tcpserver"), TcpserverError.CODE_UNSUPPORTED, "Binary tcpserver does not exist")
	return True
Example #5
0
def isSupported():
    return cmd.exists("busybox")
Example #6
0
def _check():
    VFatError.check(cmd.exists("mkfs.vfat"), VFatError.CODE_UNSUPPORTED,
                    "Binary mkfs.vfat does not exist")
    return True
Example #7
0
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
Example #8
0
def isSupported():
	return cmd.exists("aria2c")
Example #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
Example #10
0
File: brctl.py Project: 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
Example #11
0
def _check():
    IpspyError.check(cmd.exists("ipspy"), IpspyError.CODE_UNSUPPORTED,
                     "Binary ipspy does not exist")
    return True
Example #12
0
def _check():
    WebsockifyError.check(cmd.exists("websockify"),
                          WebsockifyError.CODE_UNSUPPORTED,
                          "Binary websockify does not exist")
    return True
Example #13
0
def _check():
	WebsockifyError.check(cmd.exists("websockify"), WebsockifyError.CODE_UNSUPPORTED, "Binary websockify does not exist")
	return True
Example #14
0
def _check():
    DpkgError.check(cmd.exists("dpkg-query"), DpkgError.CODE_UNSUPPORTED,
                    "Binary dpkg-query does not exist")
    return True
Example #15
0
File: dpkg.py Project: GLab/ToMaTo
def _check():
	DpkgError.check(cmd.exists("dpkg-query"), DpkgError.CODE_UNSUPPORTED, "Binary dpkg-query does not exist")
	return True
Example #16
0
def _check():
    NetstatError.check(cmd.exists("netstat"), NetstatError.CODE_UNSUPPORTED,
                       "Binary netstat does not exist")
    return True
Example #17
0
def _check():
	NetstatError.check(cmd.exists("netstat"), NetstatError.CODE_UNSUPPORTED, "Binary netstat does not exist")
	return True
Example #18
0
def _check():
	QemuImgError.check(cmd.exists("qemu-img"), QemuImgError.CODE_UNSUPPORTED, "Binary qemu-img does not exist")
	return True
Example #19
0
File: ipspy.py Project: GLab/ToMaTo
def _check():
    IpspyError.check(cmd.exists("ipspy"), IpspyError.CODE_UNSUPPORTED, "Binary ipspy does not exist")
    return True
Example #20
0
def isSupported():
	return cmd.exists("vpncloud")
Example #21
0
File: vfat.py Project: 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
Example #22
0
def isSupported():
	return cmd.exists("busybox")
Example #23
0
def _check():
    TcpserverError.check(cmd.exists("tcpserver"),
                         TcpserverError.CODE_UNSUPPORTED,
                         "Binary tcpserver does not exist")
    return True