Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
Bernd Wachter committed Dec 23, 2014
1 parent 7da8edf commit 52e8c46
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libssu/ssu.cpp
Expand Up @@ -633,13 +633,20 @@ void Ssu::updateCredentials(bool force){
}

void Ssu::updateStoreCredentials(){
SsuCoreConfig *settings = SsuCoreConfig::instance();
SsuLog *ssuLog = SsuLog::instance();

QDBusMessage message = QDBusMessage::createMethodCall("com.jolla.jollastore",
"/StoreClient",
"com.jolla.jollastore",
"storeCredentials");
QDBusPendingReply<QString, QString> reply = SsuCoreConfig::userSessionBus().asyncCall(message);
reply.waitForFinished();
if (reply.isError()) {
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 {
SsuCoreConfig *settings = SsuCoreConfig::instance();
Expand Down

0 comments on commit 52e8c46

Please sign in to comment.