diff options
Diffstat (limited to 'scripts/edit-morph')
-rwxr-xr-x | scripts/edit-morph | 12 |
1 files changed, 12 insertions, 0 deletions
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] |