Commit 52e8c464 authored by Aard's avatar Aard

[ssu] Allow passing store credential errors down to libzypp

If a device is reasonably broken the UI level might not be available.
Until the updated related components from store are available fully
in middleware this provides a workaround to rescue such devices,
given valid store credentials were written once before
parent 7da8edfa
...@@ -633,6 +633,9 @@ void Ssu::updateCredentials(bool force){ ...@@ -633,6 +633,9 @@ void Ssu::updateCredentials(bool force){
} }
void Ssu::updateStoreCredentials(){ void Ssu::updateStoreCredentials(){
SsuCoreConfig *settings = SsuCoreConfig::instance();
SsuLog *ssuLog = SsuLog::instance();
QDBusMessage message = QDBusMessage::createMethodCall("com.jolla.jollastore", QDBusMessage message = QDBusMessage::createMethodCall("com.jolla.jollastore",
"/StoreClient", "/StoreClient",
"com.jolla.jollastore", "com.jolla.jollastore",
...@@ -640,7 +643,11 @@ void Ssu::updateStoreCredentials(){ ...@@ -640,7 +643,11 @@ void Ssu::updateStoreCredentials(){
QDBusPendingReply<QString, QString> reply = SsuCoreConfig::userSessionBus().asyncCall(message); QDBusPendingReply<QString, QString> reply = SsuCoreConfig::userSessionBus().asyncCall(message);
reply.waitForFinished(); reply.waitForFinished();
if (reply.isError()) { if (reply.isError()) {
setError(QString("Store credentials not received. %1").arg(reply.error().message())); if (settings->value("ignore-credential-errors").toBool() == true){
ssuLog->print(LOG_WARNING, QString("Warning: ignore-credential-errors is set, passing auth errors down to libzypp"));
ssuLog->print(LOG_WARNING, QString("Store credentials not received. %1").arg(reply.error().message()));
} else
setError(QString("Store credentials not received. %1").arg(reply.error().message()));
} else { } else {
SsuCoreConfig *settings = SsuCoreConfig::instance(); SsuCoreConfig *settings = SsuCoreConfig::instance();
settings->beginGroup("credentials-store"); settings->beginGroup("credentials-store");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment