Skip to content

Commit

Permalink
Merge "fix: vlan id for cloud history"
Browse files Browse the repository at this point in the history
  • Loading branch information
sadsfae authored and gerritforge-ltd committed Nov 24, 2020
2 parents 59d6e62 + 6acc048 commit 9d3222a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion quads/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,17 @@ class CloudHistory(Document):

@staticmethod
def prep_data(data):
for flag in ['provisioned', 'validated', 'vlan', 'last_redefined']:
for flag in ['provisioned', 'validated', 'last_redefined']:
if flag in data:
data.pop(flag)

if 'vlan' in data:
if type(data.get('vlan')) == str:
data['vlan_id'] = int(data.get('vlan'))
elif type(data.get('vlan')) == Vlan:
data['vlan_id'] = data.get('vlan').vlan_id
data.pop('vlan')

params = ['name', 'description', 'owner', 'ticket']
result, data = param_check(data, params)

Expand Down

0 comments on commit 9d3222a

Please sign in to comment.