summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yarns.webapp/900-implementations.yarn21
1 files changed, 21 insertions, 0 deletions
diff --git a/yarns.webapp/900-implementations.yarn b/yarns.webapp/900-implementations.yarn
index 6e0b380..24dcf51 100644
--- a/yarns.webapp/900-implementations.yarn
+++ b/yarns.webapp/900-implementations.yarn
@@ -178,6 +178,27 @@ Set a specific field for a `troves` section.
yarnlib.dump_json_to_file(obj, filename)
'
+Remove a specified field for a `troves` section
+
+ IMPLEMENTS GIVEN (\S+) in (\S+) removes field (\S+) from trove (\S+)
+ cd "$SRCDIR"/yarns.webapp
+ python -c '
+ import os
+ import yarnlib
+
+ MATCH_1, MATCH_2, MATCH_3, MATCH_4 = yarnlib.matches()
+
+ filename = os.path.join(yarnlib.DATADIR, MATCH_2, MATCH_1)
+ obj = yarnlib.load_json_from_file(filename)
+
+ for section in obj:
+ if section["type"] in ["trove", "troves"]:
+ if section["trovehost"] == MATCH_4:
+ del section[MATCH_3]
+
+ yarnlib.dump_json_to_file(obj, filename)
+ '
+
Set the prefixmap for a Trove in a Lorry Controller configuration
file. Note that the Trove must already be in the configuration file.