Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-19071

nuxeoctl config must accept a template as an argument to --set option

    XMLWordPrintable

    Details

    • Impact type:
      Configuration Change
    • Upgrade notes:
      Hide

      The syntax "nuxeoctl config --set somekey" was wrongly equivalent to "nuxeoctl config somekey --set" or "nuxeoctl config --set – somekey".
      If you used that syntax, you must change it either moving the option to the end of the line after the command and its parameters, either using the "--" separator between option and command parameters to avoid confusion with option parameters.

      Show
      The syntax "nuxeoctl config --set somekey" was wrongly equivalent to "nuxeoctl config somekey --set" or "nuxeoctl config --set – somekey". If you used that syntax, you must change it either moving the option to the end of the line after the command and its parameters, either using the "--" separator between option and command parameters to avoid confusion with option parameters.
    • Sprint:
      DevOps Sprint 11

      Description

      The command description states that it is possible to store values in the templates rather than in the global nuxeo.conf (see bold parts):

      nuxeoctl config [--encrypt [<algorithm>]] [--set [<template>]] [<key> <value>].. <key> [<value>] [-d [<categories>]|-q]
      Set template or global parameters.
      The value is stored in nuxeo.conf by default unless a template name is provided; if so, it is then stored in the template's nuxeo.defaults file.

      Actually, because of the following possible confusion, that feature is missing: given bin/nuxeoctl config --set foo, how to determine if foo is a template name or a key to set?
      That is true for all options which accept an optional argument: a confusion may arise if the option has no argument and is followed by a command parameter.

      Not working syntax because of confusion between argument and parameter
      $ bin/nuxeoctl config -q --set somekey
      Template not found: somekey
      
      $ bin/nuxeoctl config -q --encrypt somekey somevalue --set
      Please enter the value for somevalue: 
      Cannot find any provider supporting somekey
      
      $ bin/nuxeoctl config -q --encrypt --set somekey somevalue 
      Please enter the value for somevalue:
      Template not found: somekey
      
      Working syntax
      $ bin/nuxeoctl config -q somekey somevalue
      
      $ bin/nuxeoctl config -q somekey --set
      Please enter the value for somekey: somevalue
      
      $ bin/nuxeoctl config -q --set -- somekey
      Please enter the value for somekey: somevalue
      
      $ bin/nuxeoctl config -q  somekey somevalue --encrypt --set
      $ bin/nuxeoctl config -q  somekey --get
      Please enter the secret key: 
      somevalue
      
      $ bin/nuxeoctl config -q --encrypt --set -- somekey somevalue 
      $ bin/nuxeoctl config -q  somekey --get
      Please enter the secret key: 
      somevalue
      

      Fix the specific case of --set option to allow passing a template as an argument.
      Fix all the wrong samples.
      Document the -- prefix which allows to separate option arguments from command parameters.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: