Skip to content

Commit

Permalink
fix(examples): Do not append 'updated via' in restore_alerts example (#…
Browse files Browse the repository at this point in the history
…147)

Each time you restore alerts "updated via restore_alerts.py" in the
description is appended so you get something like: "${DESCRITPION}
updated via restore_alerts.py updated via restore_alerts.py updated via
restore_alerts.py". This commit removes this part so the description
doesn't grow anymore.

Signed-off-by: Federico Barcelona <[email protected]>
  • Loading branch information
tembleking authored Oct 2, 2020
1 parent 443bbca commit aa11c8e
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions examples/restore_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,9 @@
if a['name'] in existing_alerts:
a['id'] = existing_alerts[a['name']]['id']
a['version'] = existing_alerts[a['name']]['version']
if a.get('description') is None:
a['description'] = '(updated via restore_alerts.py)'
else:
a['description'] += ' (updated via restore_alerts.py)'
ok, res = sdclient.update_alert(a)
updated_count += 1
else:
if a.get('description') is None:
a['description'] = '(created via restore_alerts.py)'
else:
a['description'] += ' (created via restore_alerts.py)'
ok, res = sdclient.create_alert(alert_obj=a)
created_count += 1
if not ok:
Expand Down

0 comments on commit aa11c8e

Please sign in to comment.