manifest: Serialize remote[url-base] properly
Since the python object is named url_base, this field is getting frozen via as_dict with an underscore rather than the dash required by the schema. Signed-off-by: Andy Doan <andy@foundries.io>
This commit is contained in:
parent
5d30c9c93b
commit
ab560b5c64
|
@ -359,14 +359,14 @@ class Remote:
|
||||||
return self.name == other.name and self.url_base == other.url_base
|
return self.name == other.name and self.url_base == other.url_base
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return 'Remote(name={}, url_base={})'.format(repr(self.name),
|
return 'Remote(name={}, url-base={})'.format(repr(self.name),
|
||||||
repr(self.url_base))
|
repr(self.url_base))
|
||||||
|
|
||||||
def as_dict(self):
|
def as_dict(self):
|
||||||
'''Return a representation of this object as a dict, as it would be
|
'''Return a representation of this object as a dict, as it would be
|
||||||
parsed from an equivalent YAML manifest.'''
|
parsed from an equivalent YAML manifest.'''
|
||||||
return collections.OrderedDict(
|
return collections.OrderedDict(
|
||||||
((s, getattr(self, s)) for s in self.__slots__))
|
((s.replace('_', '-'), getattr(self, s)) for s in self.__slots__))
|
||||||
|
|
||||||
|
|
||||||
class Project:
|
class Project:
|
||||||
|
|
|
@ -266,7 +266,7 @@ def test_manifest_freeze(west_update_tmpdir):
|
||||||
'^ revision: master$',
|
'^ revision: master$',
|
||||||
'^ remotes:$',
|
'^ remotes:$',
|
||||||
'^ - name: test-local$',
|
'^ - name: test-local$',
|
||||||
'^ url_base: .*$',
|
'^ url-base: .*$',
|
||||||
'^ projects:$',
|
'^ projects:$',
|
||||||
'^ - name: Kconfiglib$',
|
'^ - name: Kconfiglib$',
|
||||||
'^ remote: test-local$',
|
'^ remote: test-local$',
|
||||||
|
|
Loading…
Reference in New Issue