summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2015-04-30 02:43:08 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2015-05-11 13:13:50 +0000
commit2d2774a3b84ce9dba9b4445e842801c2768cdaa3 (patch)
treeffe86fb8e0cdd243ed7666284fd56a26545cbea7 /scripts
parente2e2ededbad299b253444b29d6d228152ef2cead (diff)
downloadmorph-2d2774a3b84ce9dba9b4445e842801c2768cdaa3.tar.gz
yarns: Add the ability to tag chunks and commit updates to definitions
Change-Id: Ia644ddfaa5138f0ad459099cf26f51b545a9f9ca
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/edit-morph12
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]