From e30b0c73cb6805689c58b3ed9d5dd091218e2df3 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 22 Jan 2014 14:48:29 +0000 Subject: yarns: Add regression test for cache-key clash --- scripts/edit-morph | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'scripts') diff --git a/scripts/edit-morph b/scripts/edit-morph index acb33b7e..2970cc6e 100755 --- a/scripts/edit-morph +++ b/scripts/edit-morph @@ -227,4 +227,22 @@ class EditMorph(cliapp.Application): with open(file_path, "w") as f: yaml.dump(d, f) + def cmd_set_stratum_match_rules(self, (file_path, match_rules)): + '''Set a stratum's match rules. + + Usage: FILE_PATH MATCH_RULES_YAML + + This sets the stratum's "products" field, which is used to + determine which chunk artifacts go into which stratum artifacts + the stratum produces. + + The match rules must be a string that yaml can parse. + + ''' + with open(file_path, "r") as f: + d = yaml.load(f) + d['products'] = yaml.load(match_rules) + with open(file_path, "w") as f: + yaml.dump(d, f) + EditMorph().run() -- cgit v1.2.1