mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
Merge branch 'master' of github.com:opencomputeproject/OpenNetworkLinux
This commit is contained in:
@@ -21,6 +21,14 @@ from InstallUtils import ProcMountsParser
|
||||
import onl.YamlUtils
|
||||
from onl.sysconfig import sysconfig
|
||||
|
||||
try:
|
||||
PartedException = parted._ped.PartedException
|
||||
DiskException = parted._ped.DiskException
|
||||
except AttributeError:
|
||||
import _ped
|
||||
PartedException = _ped.PartedException
|
||||
DiskException = _ped.DiskException
|
||||
|
||||
class Base:
|
||||
|
||||
class installmeta:
|
||||
@@ -686,11 +694,17 @@ class UbootInstaller(SubprocessMixin, Base):
|
||||
return 0
|
||||
self.log.warn("disk %s has wrong label %s",
|
||||
self.device, self.partedDisk.type)
|
||||
except Exception as ex:
|
||||
except (DiskException, PartedException) as ex:
|
||||
self.log.error("cannot get partition table from %s: %s",
|
||||
self.device, str(ex))
|
||||
except Exception:
|
||||
self.log.exception("cannot get partition table from %s",
|
||||
self.device)
|
||||
|
||||
self.log.info("creating msdos label on %s")
|
||||
self.log.info("clobbering disk label on %s", self.device)
|
||||
self.partedDevice.clobber()
|
||||
|
||||
self.log.info("creating msdos label on %s", self.device)
|
||||
self.partedDisk = parted.freshDisk(self.partedDevice, 'msdos')
|
||||
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user