diff --git a/openquake/parser/vulnerability.py b/openquake/parser/vulnerability.py
index <HASH>..<HASH> 100644
--- a/openquake/parser/vulnerability.py
+++ b/openquake/parser/vulnerability.py
@@ -115,7 +115,7 @@ class VulnerabilityModelFile(producer.FileProducer):
 
 
 # TODO (ac): These two functions should be probably moved elsewhere
-def load_vulnerability_model(job_id, path):
+def load_vulnerability_model(job_id, path, retrofitted=False):
     """Load and store the vulnerability model defined in the
     given NRML file in the underlying kvs system."""
 
@@ -129,15 +129,15 @@ def load_vulnerability_model(job_id, path):
 
         vulnerability_model[vuln_curve["ID"]] = vuln_func.to_json()
 
-    kvs.set_value_json_encoded(kvs.tokens.vuln_key(job_id),
+    kvs.set_value_json_encoded(kvs.tokens.vuln_key(job_id, retrofitted),
             vulnerability_model)
 
 
-def load_vuln_model_from_kvs(job_id):
+def load_vuln_model_from_kvs(job_id, retrofitted=False):
     """Load the vulnerability model from kvs for the given job."""
 
     vulnerability_model = kvs.get_value_json_decoded(
-            kvs.tokens.vuln_key(job_id))
+            kvs.tokens.vuln_key(job_id, retrofitted))
 
     vulnerability_curves = {}
parser/vulnerability: support for reading retrofitted models


Former-commit-id: <I>a<I>d7a0fff1e3e<I>e<I>a<I>cc2f8f<I>fe