init: fixed issue with self.path section missing in west.yml

Fixes: #218

Using empty string instead of None as None results in error when
instantiating Manifest project as special project.

Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2019-02-25 19:26:16 +01:00 committed by Carles Cufí
parent 2f68481485
commit 2598c0585a
2 changed files with 4 additions and 2 deletions

View File

@ -65,9 +65,11 @@ class PostInit(WestCommand):
rel_manifest = os.path.relpath(args.local, util.west_topdir())
_update_key(config, 'manifest', 'path', rel_manifest)
else:
if project.path is None:
if project.path == '':
url_path = urlparse(args.manifest_url).path
project.path = posixpath.basename(url_path)
project.abspath = os.path.realpath(
os.path.join(util.west_topdir(), project.path))
project.name = project.path
_inf(project, 'Creating repository for {name_and_path}')

View File

@ -207,7 +207,7 @@ class Manifest:
self_tag = manifest.get('self')
if path is None:
path = self_tag.get('path') if self_tag else None
path = self_tag.get('path') if self_tag else ''
west_commands = self_tag.get('west-commands') if self_tag else None
project = SpecialProject(path, path=path, west_commands=west_commands)