From f21ff5c40499139eb6daf5e1d711dd1e2b6141f0 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 19 Mar 2018 14:33:19 -0400 Subject: Replace on explicit string match --- pipeline_backup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pipeline_backup.py b/pipeline_backup.py index e1f5e2e..5399e99 100755 --- a/pipeline_backup.py +++ b/pipeline_backup.py @@ -22,8 +22,11 @@ class PipelineSpec: def replace(self, old, new): for idx, record in enumerate(self.data): - if old in record: - self.data[idx] = record.replace(old, new) + parts = record.split('/') + for part in parts: + if part == old: + self.data[idx] = record.replace(old, new) + break def search(self, pattern): for record in self.data: -- cgit