Skip to content

Commit 8d7b710

Browse files
operations/crontab: fix modification not properly relying on the cron_name parameter
Co-authored-by: Nick Mills-Barrett <nick@fizzadar.com>
1 parent ff4d2e2 commit 8d7b710

2 files changed

Lines changed: 3 additions & 27 deletions

File tree

src/pyinfra/operations/crontab.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def comma_sep(value):
8585
ctb = ctb0
8686
name_comment = "# pyinfra-name={0}".format(cron_name)
8787

88-
existing_crontab = ctb.get_command(command=command, name=cron_name)
88+
existing_crontab = ctb.get_command(
89+
command=command if cron_name is None else None, name=cron_name
90+
)
8991
existing_crontab_command = existing_crontab["command"] if existing_crontab else command
9092
existing_crontab_match = existing_crontab["command"] if existing_crontab else command
9193

tests/operations/crontab.crontab/edit_existing_with_newline.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)