[libcalamares] Warn (python only) about unknown GS keys
This makes it easier to spot problems where key-names are mis-spelled in Python (or other modules change a name and it's not applied to consumers)
This commit is contained in:
parent
b04d59ba2e
commit
0ccd55e33f
@ -437,14 +437,24 @@ GlobalStoragePythonWrapper::keys() const
|
|||||||
int
|
int
|
||||||
GlobalStoragePythonWrapper::remove( const std::string& key )
|
GlobalStoragePythonWrapper::remove( const std::string& key )
|
||||||
{
|
{
|
||||||
return m_gs->remove( QString::fromStdString( key ) );
|
const QString gsKey( QString::fromStdString( key ) );
|
||||||
|
if ( !m_gs->contains( gsKey ) )
|
||||||
|
{
|
||||||
|
cWarning() << "Unknown GS key" << key.c_str();
|
||||||
|
}
|
||||||
|
return m_gs->remove( gsKey );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bp::object
|
bp::object
|
||||||
GlobalStoragePythonWrapper::value( const std::string& key ) const
|
GlobalStoragePythonWrapper::value( const std::string& key ) const
|
||||||
{
|
{
|
||||||
return CalamaresPython::variantToPyObject( m_gs->value( QString::fromStdString( key ) ) );
|
const QString gsKey( QString::fromStdString( key ) );
|
||||||
|
if ( !m_gs->contains( gsKey ) )
|
||||||
|
{
|
||||||
|
cWarning() << "Unknown GS key" << key.c_str();
|
||||||
|
}
|
||||||
|
return CalamaresPython::variantToPyObject( m_gs->value( gsKey ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace CalamaresPython
|
} // namespace CalamaresPython
|
||||||
|
Loading…
Reference in New Issue
Block a user