def __get_default_sizes(self): if self.application.args.dry: udiskscmd = "udisksctl info -b /dev/[sv]da* | grep Size" stdout = process.check_output(udiskscmd, shell=True) self._drive_size = (int(stdout.strip().split(":")[1].strip()) / 1024 / 1024) return {"storage.efi_size": "256", "storage.root_size": "50", "storage.swap_size": "0", "storage.config_size": "5", "storage.logging_size": "2048", "storage.data_size": "0", } from ovirtnode.storage import Storage stor = Storage() self._drive_size = stor.get_drive_size(self.__get_install_drive()) sizes = {"storage.efi_size": "%s" % stor.EFI_SIZE, "storage.root_size": "%s" % stor.ROOT_SIZE, "storage.swap_size": "%s" % stor.SWAP_SIZE, "storage.config_size": "%s" % stor.CONFIG_SIZE, "storage.logging_size": "%s" % stor.LOGGING_SIZE, "storage.data_size": "%s" % stor.DATA_SIZE, "storage.free_space": "0 MB", "storage.drive_size": "%s MB" % self._drive_size } return sizes
def __get_drives_size(self, drives): self.logger.debug("Getting Drives Size For: %s" % drives) from ovirtnode.storage import Storage stor = Storage() drives_size = 0 for drive in drives: drives_size += int(stor.get_drive_size(drive)) self.logger.debug(drives_size) return drives_size
def __get_default_sizes(self): if self.application.args.dry: udiskscmd = "udisksctl info -b /dev/[sv]da* | grep Size" stdout = process.check_output(udiskscmd, shell=True) self._drive_size = (int(stdout.strip().split(":")[1].strip()) / 1024 / 1024) return { "storage.efi_size": "256", "storage.root_size": "50", "storage.swap_size": "0", "storage.config_size": "5", "storage.logging_size": "2048", "storage.data_size": "0", } from ovirtnode.storage import Storage stor = Storage() self._drive_size = self.__get_drives_size(self.__get_install_drive()) sizes = { "storage.efi_size": "%s" % stor.EFI_SIZE, "storage.root_size": "%s" % stor.ROOT_SIZE, "storage.swap_size": "%s" % stor.SWAP_SIZE, "storage.config_size": "%s" % stor.CONFIG_SIZE, "storage.logging_size": "%s" % stor.LOGGING_SIZE, "storage.data_size": "%s" % "0", "storage.free_space": "0 MB", "storage.drive_size": "%s MB" % self._drive_size } return sizes
def __init__(self): logger.propagate = False self.disk = None self.partN = -1 self.s = Storage() self.efi_hd = "" self.live_path = None
def __get_default_sizes(self): if self.application.args.dry: if os.geteuid() == 0: cmd = "blockdev --getsize64 /dev/[sv]da" stdout = process.check_output(cmd, shell=True) self._drive_size = int(stdout) / 1024 / 1024 else: # If we're not root and can't query the drive, # pretend it's 15G self._drive_size = 15*1024**2 return {"storage.efi_size": "%s" % presets.BOOT_SIZE_MB, "storage.root_size": "%s" % presets.ROOT_SIZE_MB, "storage.swap_size": "0", "storage.config_size": "5", "storage.logging_size": "2048", "storage.data_size": "0", "storage.install_drive": self.__get_install_drive(), "storage.fill_data": True } from ovirtnode.storage import Storage stor = Storage() self._drive_size = self.__get_drives_size(self.__get_install_drive()) sizes = {"storage.efi_size": "%s" % stor.EFI_SIZE, "storage.root_size": "%s" % stor.ROOT_SIZE, "storage.swap_size": "%s" % stor.SWAP_SIZE, "storage.config_size": "%s" % stor.CONFIG_SIZE, "storage.logging_size": "%s" % stor.LOGGING_SIZE, "storage.data_size": "%s" % "0", "storage.free_space": "0 MB", "storage.drive_size": "%s MB" % self._drive_size, "storage.install_drive": self.__get_install_drive(), "storage.fill_data": True } return sizes
def __init__(self): logger.addHandler(logging.NullHandler()) logger.propagate = False self.disk = None self.partN = -1 self.s = Storage() self.efi_hd = "" self.live_path = None self.efi_path = self._get_efi_path() self.efi_name = self.efi_path.split("/")[1]
def __get_default_sizes(self): if self.application.args.dry: return {"storage.efi_size": "256", "storage.root_size": "50", "storage.swap_size": "0", "storage.config_size": "5", "storage.logging_size": "2048", "storage.data_size": "0", } from ovirtnode.storage import Storage stor = Storage() self._drive_size = stor.get_drive_size(self.__get_install_drive()) sizes = {"storage.efi_size": "%s" % stor.EFI_SIZE, "storage.root_size": "%s" % stor.ROOT_SIZE, "storage.swap_size": "%s" % stor.SWAP_SIZE, "storage.config_size": "%s" % stor.CONFIG_SIZE, "storage.logging_size": "%s" % stor.LOGGING_SIZE, "storage.data_size": "%s" % stor.DATA_SIZE, "storage.free_space": "0 MB", "storage.drive_size": "%s MB" % self._drive_size } return sizes
def __get_default_sizes(self): if self.application.args.dry: return {"storage.efi_size": "256", "storage.root_size": "50", "storage.swap_size": "0", "storage.config_size": "5", "storage.logging_size": "2048", "storage.data_size": "0", } from ovirtnode.storage import Storage stor = Storage() sizes = {"storage.efi_size": "%s" % stor.EFI_SIZE, "storage.root_size": "%s" % stor.ROOT_SIZE, "storage.swap_size": "%s" % stor.SWAP_SIZE, "storage.config_size": "%s" % stor.CONFIG_SIZE, "storage.logging_size": "%s" % stor.LOGGING_SIZE, "storage.data_size": "%s" % stor.DATA_SIZE, } return sizes
def __get_min_sizes(self): if self.application.args.dry: return 2048, 256 from ovirtnode.storage import Storage stor = Storage() return stor.MIN_SWAP_SIZE, stor.MIN_LOGGING_SIZE