From 2d2774a3b84ce9dba9b4445e842801c2768cdaa3 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Thu, 30 Apr 2015 02:43:08 +0000 Subject: yarns: Add the ability to tag chunks and commit updates to definitions Change-Id: Ia644ddfaa5138f0ad459099cf26f51b545a9f9ca --- scripts/edit-morph | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scripts') diff --git a/scripts/edit-morph b/scripts/edit-morph index 8c0863c3..a3f857df 100755 --- a/scripts/edit-morph +++ b/scripts/edit-morph @@ -22,6 +22,7 @@ import yaml import morphlib + class EditMorph(cliapp.Application): '''Tools for performing set operations on large morphologies''' @@ -204,6 +205,17 @@ class EditMorph(cliapp.Application): with self._open_yaml(file_path) as d: d['products'] = yaml.load(match_rules) + def cmd_update_stratum_chunk_ref(self, (file_path, chunk_name, chunk_ref)): + '''Update a chunk in a stratum's ref + + Usage: FILE_PATH CHUNK_NAME CHUNK_REF + + ''' + with self._open_yaml(file_path) as d: + for spec in d['chunks']: + if spec.get('alias', spec['name']) == chunk_name: + spec['ref'] = chunk_ref + @classmethod def _splice_cluster_system(cls, syslist, syspath): sysname = syspath[0] -- cgit v1.2.1