From 1d40561bbd3aac552c8585d09d8436884aabdee7 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 17 Jun 2019 20:19:21 +0200 Subject: [HTTP API] T1431: make the value field optional. --- src/services/vyos-http-api-server | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/services') diff --git a/src/services/vyos-http-api-server b/src/services/vyos-http-api-server index 301c083a1..834c06b4d 100755 --- a/src/services/vyos-http-api-server +++ b/src/services/vyos-http-api-server @@ -109,13 +109,15 @@ def configure(): raise ConfigSessionError("Malformed command \"{0}\": missing \"op\" field".format(json.dumps(c))) if not ('path' in c): raise ConfigSessionError("Malformed command \"{0}\": missing \"path\" field".format(json.dumps(c))) + # Missing value is fine, substitute for empty string - if not ('value' in c): + if 'value' in c: + value = c['value'] + else: value = "" op = c['op'] path = c['path'] - value = c['value'] # Type checking if not isinstance(path, list): -- cgit v1.2.3