[welcome] Improve error reporting from requirements checker
This commit is contained in:
parent
e628ddfdbf
commit
02dfe51d55
@ -213,12 +213,16 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
bool ok = false;
|
bool ok = false;
|
||||||
m_requiredStorageGB = configurationMap.value( "requiredStorage" ).toDouble( &ok );
|
m_requiredStorageGB = configurationMap.value( "requiredStorage" ).toDouble( &ok );
|
||||||
if ( !ok )
|
if ( !ok )
|
||||||
|
{
|
||||||
|
cDebug() << "WARNING: RequirementsChecker entry 'requiredStorage' is invalid.";
|
||||||
m_requiredStorageGB = 3.;
|
m_requiredStorageGB = 3.;
|
||||||
|
}
|
||||||
|
|
||||||
Calamares::JobQueue::instance()->globalStorage()->insert( "requiredStorageGB", m_requiredStorageGB );
|
Calamares::JobQueue::instance()->globalStorage()->insert( "requiredStorageGB", m_requiredStorageGB );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
cDebug() << "WARNING: RequirementsChecker entry 'requiredStorage' is missing.";
|
||||||
m_requiredStorageGB = 3.;
|
m_requiredStorageGB = 3.;
|
||||||
incompleteConfiguration = true;
|
incompleteConfiguration = true;
|
||||||
}
|
}
|
||||||
@ -231,12 +235,14 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
m_requiredRamGB = configurationMap.value( "requiredRam" ).toDouble( &ok );
|
m_requiredRamGB = configurationMap.value( "requiredRam" ).toDouble( &ok );
|
||||||
if ( !ok )
|
if ( !ok )
|
||||||
{
|
{
|
||||||
|
cDebug() << "WARNING: RequirementsChecker entry 'requiredRam' is invalid.";
|
||||||
m_requiredRamGB = 1.;
|
m_requiredRamGB = 1.;
|
||||||
incompleteConfiguration = true;
|
incompleteConfiguration = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
cDebug() << "WARNING: RequirementsChecker entry 'requiredRam' is missing.";
|
||||||
m_requiredRamGB = 1.;
|
m_requiredRamGB = 1.;
|
||||||
incompleteConfiguration = true;
|
incompleteConfiguration = true;
|
||||||
}
|
}
|
||||||
@ -248,7 +254,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
if ( m_checkHasInternetUrl.isEmpty() ||
|
if ( m_checkHasInternetUrl.isEmpty() ||
|
||||||
!QUrl( m_checkHasInternetUrl ).isValid() )
|
!QUrl( m_checkHasInternetUrl ).isValid() )
|
||||||
{
|
{
|
||||||
cDebug() << "Invalid internetCheckUrl in welcome.conf" << m_checkHasInternetUrl
|
cDebug() << "WARNING: RequirementsChecker entry 'internetCheckUrl' is invalid in welcome.conf" << m_checkHasInternetUrl
|
||||||
<< "reverting to default (http://example.com).";
|
<< "reverting to default (http://example.com).";
|
||||||
m_checkHasInternetUrl = "http://example.com";
|
m_checkHasInternetUrl = "http://example.com";
|
||||||
incompleteConfiguration = true;
|
incompleteConfiguration = true;
|
||||||
@ -256,8 +262,9 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cDebug() << "internetCheckUrl is undefined in welcome.conf, "
|
cDebug() << "WARNING: RequirementsChecker entry 'internetCheckUrl' is undefined in welcome.conf,"
|
||||||
"reverting to default (http://example.com).";
|
"reverting to default (http://example.com).";
|
||||||
|
|
||||||
m_checkHasInternetUrl = "http://example.com";
|
m_checkHasInternetUrl = "http://example.com";
|
||||||
incompleteConfiguration = true;
|
incompleteConfiguration = true;
|
||||||
}
|
}
|
||||||
@ -269,7 +276,10 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
m_entriesToCheck.append( configurationMap.value( "check" ).toStringList() );
|
m_entriesToCheck.append( configurationMap.value( "check" ).toStringList() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
cDebug() << "WARNING: RequirementsChecker entry 'check' is incomplete.";
|
||||||
incompleteConfiguration = true;
|
incompleteConfiguration = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ( configurationMap.contains( "required" ) &&
|
if ( configurationMap.contains( "required" ) &&
|
||||||
configurationMap.value( "required" ).type() == QVariant::List )
|
configurationMap.value( "required" ).type() == QVariant::List )
|
||||||
@ -278,18 +288,13 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
m_entriesToRequire.append( configurationMap.value( "required" ).toStringList() );
|
m_entriesToRequire.append( configurationMap.value( "required" ).toStringList() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
cDebug() << "WARNING: RequirementsChecker entry 'required' is incomplete.";
|
||||||
incompleteConfiguration = true;
|
incompleteConfiguration = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ( incompleteConfiguration )
|
if ( incompleteConfiguration )
|
||||||
{
|
cDebug() << "WARNING: RequirementsChecker configuration map:\n" << configurationMap;
|
||||||
cDebug() << "WARNING: The RequirementsChecker configuration map provided by "
|
|
||||||
"the welcome module configuration file is incomplete or "
|
|
||||||
"incorrect.\n"
|
|
||||||
"Startup will continue for debugging purposes, but one or "
|
|
||||||
"more checks might not function correctly.\n"
|
|
||||||
"RequirementsChecker configuration map:\n"
|
|
||||||
<< configurationMap;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user