Skip to content

Commit

Permalink
Use the name attribute from fabric dict if exists
Browse files Browse the repository at this point in the history
When creating the fabrics, use the name attribute from the fabric dict
if that exists. If no name is specified, fall back to the dict key as
the legacy implementation did

Change-Id: Ica4d3a0261ae2ff849ac1bbc07251a9f73b74a43
  • Loading branch information
Gabor Toth authored and ebotzol committed Sep 5, 2018
1 parent 902ae41 commit 05db52b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _modules/maas.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,12 @@ def __init__(self):
self._config_path = 'region.fabrics'

def fill_data(self, name, fabric):
try:
fabric_name = fabric['name']
except KeyError:
fabric_name = name
data = {
'name': name,
'name': fabric_name,
'description': fabric.get('description', ''),
}
if 'class_type' in fabric:
Expand Down

0 comments on commit 05db52b

Please sign in to comment.