ext: Disable extension if a dependency isn't of the correct version

Fixes #657
This commit is contained in:
Stein Magnus Jodal 2014-01-21 14:46:27 +01:00
parent 3c0cc1564c
commit 7ce38de351
2 changed files with 14 additions and 0 deletions

View File

@ -4,6 +4,14 @@ Changelog
This changelog is used to track all major changes to Mopidy.
v0.18.1 (UNRELEASED)
====================
- Disable extension instead of crashing if a dependency has the wrong
version. (Fixes: :issue:`657`)
v0.18.0 (2014-01-19)
====================

View File

@ -222,6 +222,12 @@ def validate_extension(extension):
'Disabled extension %s: Dependency %s not found',
extension.ext_name, ex)
return False
except pkg_resources.VersionConflict as ex:
found, required = ex.args
logger.info(
'Disabled extension %s: %s required, but found %s at %s',
extension.ext_name, required, found, found.location)
return False
try:
extension.validate_environment()