summaryrefslogtreecommitdiff
path: root/src/services/vyos-http-api-server
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-06-17 20:19:21 +0200
committerDaniil Baturin <daniil@baturin.org>2019-06-17 20:19:21 +0200
commit1d40561bbd3aac552c8585d09d8436884aabdee7 (patch)
treefd46d5de16f866026ff4eb8d6466ed29f4884596 /src/services/vyos-http-api-server
parent8b66a1775fc9cf508195ec5c49c9e3516f37a23a (diff)
downloadvyos-1x-1d40561bbd3aac552c8585d09d8436884aabdee7.tar.gz
vyos-1x-1d40561bbd3aac552c8585d09d8436884aabdee7.zip
[HTTP API] T1431: make the value field optional.
Diffstat (limited to 'src/services/vyos-http-api-server')
-rwxr-xr-xsrc/services/vyos-http-api-server6
1 files changed, 4 insertions, 2 deletions
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):