diff options
author | Daniil Baturin <daniil@baturin.org> | 2019-06-17 20:19:21 +0200 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2019-06-17 20:19:21 +0200 |
commit | 1d40561bbd3aac552c8585d09d8436884aabdee7 (patch) | |
tree | fd46d5de16f866026ff4eb8d6466ed29f4884596 | |
parent | 8b66a1775fc9cf508195ec5c49c9e3516f37a23a (diff) | |
download | vyos-1x-1d40561bbd3aac552c8585d09d8436884aabdee7.tar.gz vyos-1x-1d40561bbd3aac552c8585d09d8436884aabdee7.zip |
[HTTP API] T1431: make the value field optional.
-rwxr-xr-x | src/services/vyos-http-api-server | 6 |
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): |