Merge lp://qastaging/~chad.smith/charms/trusty/landscape-client/landscape-client-scrub-whitespace into lp://qastaging/charms/trusty/landscape-client

Proposed by Chad Smith
Status: Merged
Approved by: Chad Smith
Approved revision: 55
Merged at revision: 55
Proposed branch: lp://qastaging/~chad.smith/charms/trusty/landscape-client/landscape-client-scrub-whitespace
Merge into: lp://qastaging/charms/trusty/landscape-client
Diff against target: 44 lines (+22/-1)
2 files modified
hooks/hooks.py (+1/-1)
hooks/test_hooks.py (+21/-0)
To merge this branch: bzr merge lp://qastaging/~chad.smith/charms/trusty/landscape-client/landscape-client-scrub-whitespace
Reviewer Review Type Date Requested Status
Bogdana Vereha (community) Approve
Adam Collard (community) Approve
Review via email: mp+290525@code.qastaging.launchpad.net

Commit message

landscape-client charm now strips leading and trailing whitespace from any provided service config settings provided by juju set X=""" Y """. Helps with include-file:// juju-deployer directives that may contain newlines.

Description of the change

landscape-client charm now strips leading and trailing whitespace from any provided service config settings provided by juju.

For dev testing:
juju switch local
juju bootstrap

# setup a landscape account with freshdata
# set account registration key to asdfasdf (example IP of local 'OPL': 192.168.2.11)
echo -e "asdfasdf\n" > /tmp/my-regkey

Use a bundle something like the following:

local-client:
    series: trusty
    services:
        ubuntu:
            charm: cs:trusty/ubuntu-1
            num_units: 1
        landscape-client:
            branch: lp:~chad.smith/charms/trusty/landscape-client/landscape-client-scrub-whitespace
            num_units: 0
            options:
                account-name: onward
                url: http://192.168.2.11:8080/message-system
                ping-url: http://192.168.2.11:8081/ping
                registration-key: include-file:///tmp/my-regkey
    relations:
        - [ubuntu, landscape-client]

# client should register despite the newline in the /tmp/my-regkey
# juju ssh ubuntu/0 'sudo cat /etc/landscape/client.conf'
# ensure registration-key does not contain a newline, like the following:
registration_key = """asdfasdf
"""

To post a comment you must log in.
Revision history for this message
Adam Collard (adam-collard) wrote :

Looks good! +1

review: Approve
Revision history for this message
Bogdana Vereha (bogdana) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: