Code review comment for lp:~jimbaker/pyjuju/format-2-raw

Jim Baker (jimbaker) wrote :

Reviewers: mp+122380_code.launchpad.net,

Message:
Please take a look.

Description:
Modify format 2 so that it supports raw strings

This branch modifies the current format 2 support as follows:

config-get/set:
  - type int: Reads "1"; Writes "1" (no quotes)
  - type float: Reads "1" or "1.0"; Writes "1.0" (no quotes)
  - type boolean: Reads lower(v) in "true" or "false"; Writes "true" or
"false"
  - type string: Reads raw data; Writes raw data

relation-get/set
  - String: Reads raw data; Writes raw data

relation-get -
  - YAML output with string keys and raw data values (no nesting!)

  - JSON output with string keys and raw data values (no nesting!) -
    however, high byte strings that are not legal Unicode are base64
    encoded. This should be the same as seen in golang and seems to be
    a fairly common standard

I have tested this with format 1 and format 2 charms interoperating,
as well as various scenarios of raw string input/ouput to ensure that
no extraneous bytes are added, or bytes are lost, and have added
appropriate unit tests. In particular, this branch ensures the support
of null bytes in raw strings. Note that bash can be tricky to use with
null bytes, but this is not a limitation of Juju itself.

https://code.launchpad.net/~jimbaker/juju/format-2-raw/+merge/122380

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/6490069/

Affected files:
   A [revision details]
   M juju/charm/config.py
   M juju/control/tests/test_config_set.py
   M juju/hooks/cli.py
   M juju/hooks/protocol.py
   M juju/hooks/tests/test_cli.py
   M juju/hooks/tests/test_invoker.py
   M juju/lib/format.py
   M juju/lib/tests/test_format.py

« Back to merge proposal