From d5a026d91a3edb5fe492b6c48c476cd97fa4c230 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 14 Oct 2021 22:34:37 -0400 Subject: [PATCH] context: Interpret legacy-style context as read context only This provides a better migration path than surprising users with the write context functionality out of the blue. Closes #2620. --- src/Context.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index 565d6abc3..475b13705 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -966,14 +966,14 @@ std::string Context::getTaskContext (const std::string& kind, std::string name, } // Figure out the context string for this kind (read/write) - std::string contextString; + std::string contextString = ""; - if (! config.has ("context." + name + "." + kind)) + if (! config.has ("context." + name + "." + kind) && kind == "read") { debug ("Specific " + kind + " context for '" + name + "' not defined. "); if (fallback) { - debug ("Falling back on generic."); + debug ("Trying to interpret old-style context definition as read context."); contextString = config.get ("context." + name); } }