-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flux kvs get/put need type-hint options #1159
Comments
I like this approach, though it is a change from how the command has always worked. However, long term it seems like the most reasonable UI for the command. |
Closed
This was referenced Sep 28, 2017
garlick
added a commit
to garlick/flux-core
that referenced
this issue
Oct 24, 2017
Problem: flux-kvs put presumes values should be stored as JSON, but the KVS no longer requires this. Add type options to allow the user to choose how values are stored. If no options, value is stored as a NULL terminated string. If --raw, value is stored as with no options, but without a NULL terminator. If --json, value is stored as a NULL terminated string if it is valid encoded JSON; otherwise it is first encoded as a JSON string. This mimics the old default behavior of flux-kvs put that is expected by many tests in t1000-kvs.t and t1002-kvs-extra.t. Add --json to flux kvs put where used in various sharness tests. Partial fix to flux-framework#1159.
garlick
added a commit
to garlick/flux-core
that referenced
this issue
Oct 24, 2017
Problem: flux-get put presumes values should be interpreted as JSON, but the KVS no longer requires this. Add type options mirroring those added to the "put" subcommand to allow the user to choose how values are interpreted. If no options, value is interpreted as a NULL terminated string and written to stdout with a newline. If --raw, value is interpreted as raw data and is written to stdout without any formatting. If --json, value is interpreted as encoded JSON. If the value is an object or array, or any scalar type but string, it is displayed in its encoded form. If the value is a JSON strong, quotes are removed, which mimics the old default behavior of flux-kvs get expected by many sharness tests. Add --json to flux kvs get where used in various sharness tests. Fixes flux-framework#1159
garlick
added a commit
to garlick/flux-core
that referenced
this issue
Oct 25, 2017
Problem: flux-kvs put presumes values should be stored as JSON, but the KVS no longer requires this. Add type options to allow the user to choose how values are stored. If no options, value is stored as a NULL terminated string. If --raw, value is stored as with no options, but without a NULL terminator. If --json, value is stored as a NULL terminated string if it is valid encoded JSON; otherwise it is first encoded as a JSON string. This mimics the old default behavior of flux-kvs put that is expected by many tests in t1000-kvs.t and t1002-kvs-extra.t. Add --json to flux kvs put where used in various sharness tests. Partial fix to flux-framework#1159.
garlick
added a commit
to garlick/flux-core
that referenced
this issue
Oct 25, 2017
Problem: flux-get put presumes values should be interpreted as JSON, but the KVS no longer requires this. Add type options mirroring those added to the "put" subcommand to allow the user to choose how values are interpreted. If no options, value is interpreted as a NULL terminated string and written to stdout with a newline. If --raw, value is interpreted as raw data and is written to stdout without any formatting. If --json, value is interpreted as encoded JSON. If the value is an object or array, or any scalar type but string, it is displayed in its encoded form. If the value is a JSON strong, quotes are removed, which mimics the old default behavior of flux-kvs get expected by many sharness tests. Add --json to flux kvs get where used in various sharness tests. Fixes flux-framework#1159
garlick
added a commit
to garlick/flux-core
that referenced
this issue
Oct 26, 2017
Problem: flux-kvs put presumes values should be stored as JSON, but the KVS no longer requires this. Add type options to allow the user to choose how values are stored. If no options, value is stored as a NULL terminated string. If --raw, value is stored as with no options, but without a NULL terminator. If --json, value is stored as a NULL terminated string if it is valid encoded JSON; otherwise it is first encoded as a JSON string. This mimics the old default behavior of flux-kvs put that is expected by many tests in t1000-kvs.t and t1002-kvs-extra.t. Add --json to flux kvs put where used in various sharness tests. Partial fix to flux-framework#1159.
garlick
added a commit
to garlick/flux-core
that referenced
this issue
Oct 26, 2017
Problem: flux-get put presumes values should be interpreted as JSON, but the KVS no longer requires this. Add type options mirroring those added to the "put" subcommand to allow the user to choose how values are interpreted. If no options, value is interpreted as a NULL terminated string and written to stdout with a newline. If --raw, value is interpreted as raw data and is written to stdout without any formatting. If --json, value is interpreted as encoded JSON. If the value is an object or array, or any scalar type but string, it is displayed in its encoded form. If the value is a JSON string, quotes are removed, which mimics the old default behavior of flux-kvs get expected by many sharness tests. Add --json to flux kvs get where used in various sharness tests. Fixes flux-framework#1159
garlick
added a commit
to garlick/flux-core
that referenced
this issue
Oct 26, 2017
Problem: flux-kvs put presumes values should be stored as JSON, but the KVS no longer requires this. Add type options to allow the user to choose how values are stored. If no options, value is stored as a NULL terminated string. If --raw, value is stored as with no options, but without a NULL terminator. For --raw mode only, key=- may be used to take read value from stdin. If --json, value is stored as a NULL terminated string if it is valid encoded JSON; otherwise it is first encoded as a JSON string. This mimics the old default behavior of flux-kvs put that is expected by many tests in t1000-kvs.t and t1002-kvs-extra.t. Add --json to flux kvs put where used in various sharness tests. Partial fix to flux-framework#1159.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
flux kvs get
command presumes that all values are JSON. That assumption no longer holds after PR #1154.We could add
--raw
and--json
options. If neither is specified, first attempt to decode as JSON, and if that fails, presume raw.Also, supporting multiple keys on the command line doesn't really work now, since values are separated by a newline, and values can contain a newline. With raw data, this becomes even less useful, so we should probably not allow it.
The
flux kvs put
command assumes values are JSON, with a fallback to convert to a JSON string if the value doesn't decode as valid JSON.Here again, let's support only a single key, and add
--json
and--raw
options. To support redirecting raw data from stdin, if=value
is missing, stdin should be used. The fallback JSON string behavior should be eliminated.The text was updated successfully, but these errors were encountered: