From 447bd2d3978245168a0a574eb921ab5b0fe21c60 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Fri, 9 Dec 2011 17:12:56 +0400 Subject: [PATCH] Add check package for PXE installation. --- pym/cl_install.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pym/cl_install.py b/pym/cl_install.py index c199d5f..64db520 100644 --- a/pym/cl_install.py +++ b/pym/cl_install.py @@ -28,7 +28,8 @@ from cl_utils import runOsCommand,appendProgramToEnvFile, \ detectDeviceForPartition,listDirectory, \ cmpVersion,STDOUT,getUdevDeviceInfo, \ getLvmPartitions,getInstalledVideo, \ - getSupportArch, refreshLVM, refreshUdev + getSupportArch, refreshLVM, refreshUdev, \ + isPkgInstalled from cl_vars_share import varsShare from cl_kernel_utils import KernelConfig,InitRamFs @@ -2442,6 +2443,8 @@ class cl_install(color_print, SignalInterrupt): distrCopy = False if not self.checkCorrectBootRecordDisk(): return False + if pxe and not self.checkNeedPxePkg(): + return False try: rootPartdev = self.clVars.Get('os_install_root_dev') rootPartCmdList = filter(lambda x: x['dev']==rootPartdev, @@ -2730,3 +2733,13 @@ the system") + " (yes/no)" if march == "auto": march = getSupportArch()[-1] self.clVars.Set('os_install_arch_machine', march, True) + + def checkNeedPxePkg(self): + """Check need for --pxe packages""" + for pkg in ['net-misc/dhcp','net-ftp/tftp-hpa','net-fs/nfs-utils']: + if not isPkgInstalled(pkg): + self.printERROR( + _("You must to install %s package for PXE installation") + %pkg) + return False + return True