Merge "Show name_or_id when router name is white space"

This commit is contained in:
Jenkins 2016-06-30 12:03:33 +00:00 committed by Gerrit Code Review
commit c6f3f6f332

View File

@ -72,7 +72,7 @@ class NeutronAPIDictWrapper(base.APIDictWrapper):
def set_id_as_name_if_empty(self, length=8): def set_id_as_name_if_empty(self, length=8):
try: try:
if not self._apidict['name']: if not self._apidict['name'].strip():
id = self._apidict['id'] id = self._apidict['id']
if length: if length:
id = id[:length] id = id[:length]
@ -85,7 +85,7 @@ class NeutronAPIDictWrapper(base.APIDictWrapper):
@property @property
def name_or_id(self): def name_or_id(self):
return (self._apidict.get('name') or return (self._apidict.get('name').strip() or
'(%s)' % self._apidict['id'][:13]) '(%s)' % self._apidict['id'][:13])