Show error when boards manifest doesn't contain required fields

This commit is contained in:
Ivan Kravets
2016-08-26 01:29:26 +03:00
parent 8cc54bf9be
commit 6ff99e4ddd
2 changed files with 5 additions and 2 deletions

View File

@ -45,7 +45,7 @@ class UnknownPlatform(PlatformioException):
class PlatformNotInstalledYet(PlatformioException):
MESSAGE = "The platform '{0}' has not been installed yet. "\
"Use `platformio platforms install {0}` command"
"Use `platformio platform install {0}` command"
class BoardNotDefined(PlatformioException):

View File

@ -496,7 +496,10 @@ class PlatformBoardConfig(object):
self._manifest = util.load_json(manifest_path)
except ValueError:
raise exception.InvalidBoardManifest(manifest_path)
assert set(["name", "url", "vendor"]) <= set(self._manifest.keys())
if not set(["name", "url", "vendor"]) <= set(self._manifest.keys()):
raise exception.PlatformioException(
"Please specify name, url and vendor fields for " +
manifest_path)
def get(self, path, default=None):
try: