Skip to content

Commit 6533b6f

Browse files
authored
Remove default action text (#214)
1 parent fc91c10 commit 6533b6f

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

alertaclient/commands/cmd_action.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import re
2-
31
import click
42

53
from alertaclient.utils import action_progressbar, build_query
@@ -25,7 +23,5 @@ def cli(obj, action, ids, query, filters, text):
2523
total, _, _ = client.get_count(query)
2624
ids = [a.id for a in client.get_alerts(query)]
2725

28-
action_text = re.sub('([A-Z])', r' \1', action).title() # 'createIssue' => 'Create Issue'
29-
label = 'Action {} {} alerts'.format(action, total)
30-
text = text or '{} using CLI'.format(action_text)
26+
label = 'Action ({}) {} alerts'.format(action, total)
3127
action_progressbar(client, action=action, ids=ids, label=label, text=text)

alertaclient/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def show_skipped(id):
5555
with click.progressbar(ids, label=label, show_eta=True, item_show_func=show_skipped) as bar:
5656
for id in bar:
5757
try:
58-
client.action(id, action=action, text=text or 'status changed using CLI', timeout=timeout)
58+
client.action(id, action=action, text=text, timeout=timeout)
5959
except Exception:
6060
skipped += 1
6161

0 commit comments

Comments
 (0)