Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(20)

Issue 6490069: Modify format 2 so that it supports raw strings

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years ago by jimbaker
Modified:
7 years ago
Reviewers:
hazmat, mp+122380
Visibility:
Public.

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)

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+286 lines, -147 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M juju/charm/config.py View 1 chunk +1 line, -1 line 0 comments Download
M juju/control/tests/test_config_set.py View 2 chunks +1 line, -22 lines 0 comments Download
M juju/hooks/cli.py View 2 chunks +17 lines, -2 lines 1 comment Download
M juju/hooks/protocol.py View 1 chunk +0 lines, -1 line 0 comments Download
M juju/hooks/tests/test_cli.py View 2 chunks +7 lines, -24 lines 0 comments Download
M juju/hooks/tests/test_invoker.py View 7 chunks +230 lines, -40 lines 0 comments Download
M juju/lib/format.py View 5 chunks +17 lines, -24 lines 0 comments Download
M juju/lib/tests/test_format.py View 4 chunks +11 lines, -33 lines 0 comments Download

Messages

Total messages: 2
jimbaker
Please take a look.
7 years ago (2012-09-01 05:47:32 UTC) #1
hazmat
7 years ago (2012-09-04 02:09:31 UTC) #2
looks great, +1

https://codereview.appspot.com/6490069/diff/1/juju/hooks/cli.py
File juju/hooks/cli.py (right):

https://codereview.appspot.com/6490069/diff/1/juju/hooks/cli.py#newcode233
juju/hooks/cli.py:233: # encoded; workaround by firt testing whether it can be
s/firt/first
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b