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

Jim Baker (jimbaker) wrote :


Please take a look.

Modify format 2 so that it supports raw strings

This branch modifies the current format 2 support as follows:

  - 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
  - type string: Reads raw data; Writes raw data

  - 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.

(do not edit description out of merge proposal)

Please review this at

Affected files:
   A [revision details]
   M juju/charm/
   M juju/control/tests/
   M juju/hooks/
   M juju/hooks/
   M juju/hooks/tests/
   M juju/hooks/tests/
   M juju/lib/
   M juju/lib/tests/

« Back to merge proposal