def __update_profile(self, rng_num_bytes=None, disable_aes=False): additional_lines = [] utils.fs.Config().unpersist("/etc/profile") process.check_call("sed -ic '/OPENSSL_DISABLE_AES_NI/d' /etc/profile", shell=True) if disable_aes: additional_lines += ["export OPENSSL_DISABLE_AES_NI=1"] process.check_call("sed -ic '/SSH_USE_STRONG_RNG/d' /etc/profile", shell=True) if rng_num_bytes: additional_lines += ["export SSH_USE_STRONG_RNG=%s" % rng_num_bytes] if additional_lines: self.logger.debug("Updating /etc/profile") lines = "\n" + "\n".join(additional_lines) File("/etc/profile").write(lines, "a") utils.fs.Config().persist("/etc/profile") self.restart()
def __update_profile(self, rng_num_bytes, disable_aes): additional_lines = [] process.check_call("sed -ic '/OPENSSL_DISABLE_AES_NI/d' /etc/profile", shell=True) if disable_aes: additional_lines += ["export OPENSSL_DISABLE_AES_NI=1"] process.check_call("sed -ic '/SSH_USE_STRONG_RNG/d' /etc/profile", shell=True) if rng_num_bytes: additional_lines += [ "export SSH_USE_STRONG_RNG=%s" % rng_num_bytes ] if additional_lines: self.logger.debug("Updating /etc/profile") lines = "\n" + "\n".join(additional_lines) File("/etc/profile").write(lines, "a") self.restart()
def __update_profile(self, rng_num_bytes, disable_aes): import ovirtnode.ovirtfunctions as ofunc additional_lines = [] ofunc.unmount_config("/etc/profile") process.check_call("sed -i '/OPENSSL_DISABLE_AES_NI/d' /etc/profile") if disable_aes: additional_lines += ["export OPENSSL_DISABLE_AES_NI=1"] process.check_call("sed -i '/SSH_USE_STRONG_RNG/d' /etc/profile") if rng_num_bytes: additional_lines += ["export SSH_USE_STRONG_RNG=%s" % rng_num_bytes] if additional_lines: self.logger.debug("Updating /etc/profile") lines = "\n" + "\n".join(additional_lines) File("/etc/profile").write(lines, "a") ofunc.ovirt_store_config("/etc/profile") self.restart()
def __update_profile(self, rng_num_bytes, disable_aes): import ovirtnode.ovirtfunctions as ofunc additional_lines = [] ofunc.unmount_config("/etc/profile") process.check_call("sed -i '/OPENSSL_DISABLE_AES_NI/d' /etc/profile") if disable_aes: additional_lines += ["export OPENSSL_DISABLE_AES_NI=1"] process.check_call("sed -i '/SSH_USE_STRONG_RNG/d' /etc/profile") if rng_num_bytes: additional_lines += [ "export SSH_USE_STRONG_RNG=%s" % rng_num_bytes ] if additional_lines: self.logger.debug("Updating /etc/profile") lines = "\n" + "\n".join(additional_lines) File("/etc/profile").write(lines, "a") ofunc.ovirt_store_config("/etc/profile") self.restart()
def mount_efi(target="/liveos/efi"): """Mount the EFI config partition """ if os.path.ismount(target): return True if is_iscsi() or Filesystem.by_label("Boot"): efi_part = Filesystem.by_label("Boot").device else: efi_part = Filesystem.by_label("Root").device # Get the first partition on the disk efi_part = efi_part[:-1] + "1" if not os.path.exists(target): if not process.check_call(["mkdir", "-v", "-p", target]): LOGGER.exception("Unable to create mount target for EFI " "partition") raise RuntimeError("Unable to create mount target for EFI " "partition") Mount(target, efi_part, "vfat").mount()
def _start_daemon(): check_call( ["launchctl", "bootstrap", "gui/%s" % os.getuid(), LAUNCHD_FILE])