From 5f01a8ccc557d83e5417c657c035ce6dba0e9bd6 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 3 May 2019 09:00:38 -0400 Subject: [PATCH] [oemid] If the configuration is broken, complain loudly - Adds an InvalidConfiguration value for internal errors SEE #1136 --- src/libcalamares/Job.h | 3 ++- src/modules/oemid/IDJob.cpp | 13 ++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libcalamares/Job.h b/src/libcalamares/Job.h index 04b4560a4..14924af35 100644 --- a/src/libcalamares/Job.h +++ b/src/libcalamares/Job.h @@ -40,7 +40,8 @@ public: { NoError = 0, GenericError = -1, - PythonUncaughtException = 1 + PythonUncaughtException = 1, + InvalidConfiguration = 2 } ; JobResult( const JobResult& rhs ) = delete; diff --git a/src/modules/oemid/IDJob.cpp b/src/modules/oemid/IDJob.cpp index 07ce1efad..16461b191 100644 --- a/src/modules/oemid/IDJob.cpp +++ b/src/modules/oemid/IDJob.cpp @@ -82,13 +82,12 @@ Calamares::JobResult IDJob::exec() QString targetFile = QStringLiteral( "oem-id" ); QString rootMount = gs->value( "rootMountPoint" ).toString(); - static const char noRoot[] = "No rootMountPoint is set."; - static const char yesRoot[] = "rootMountPoint is set:"; - - QString targetPath; - + // Don't bother translating internal errors if ( rootMount.isEmpty() && Calamares::Settings::instance()->doChroot() ) - cWarning() << Logger::SubEntry << noRoot; - + return Calamares::JobResult::internalError( + "OEM Batch Identifier", + "No rootMountPoint is set, but a chroot is required. " + "Is there a module before oemid that sets up the partitions?", + Calamares::JobResult::InvalidConfiguration ); return writeId( Calamares::Settings::instance()->doChroot() ? rootMount + targetDir : targetDir, targetFile, m_batchIdentifier ); }