Comment 1 for bug 1020635

Revision history for this message
Kapil Thangavelu (hazmat) wrote : Re: [Bug 1020635] [NEW] cannot store yaml in relation settings

do you have a sample charm for this? there is no rel data in the topology,
so it would be interesting to test out.

On Tue, Jul 3, 2012 at 12:04 PM, Clint Byrum <email address hidden> wrote:

> Public bug reported:
>
> Test case:
>
> 1. create a charm with a relation hook which stores this yaml using
> relation-set, like this:
>
> --- begin monitors.yaml ---
> version: '0.1'
> monitors:
> nrpe:
> mysqld:
> name: MySQL Running
> args:
> command: check_procs
> args: '-c 1: /usr/sbin/mysqld'
> mysql:
> basic:
> --- end monitors.yaml ---
>
> #!/bin/sh
> relation-set something=$(cat monitors.yaml)
>
> This appears to corrupt the topology node since it is not escaped
> properly:
>
> 2012-07-03 15:17:48,451: twisted@ERROR: Unhandled Error
> Traceback (most recent call last):
> File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line
> 1181, in unwindGenerator
> return _inlineCallbacks(None, gen, Deferred())
> File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line
> 1039, in _inlineCallbacks
> result = g.send(result)
> File "/usr/lib/python2.7/dist-packages/juju/state/hook.py", line 258, in
> _setup_relation_state
> unit_id = yield self._resolve_name(unit_name)
> File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line
> 1181, in unwindGenerator
> return _inlineCallbacks(None, gen, Deferred())
> --- <exception caught here> ---
> File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line
> 1039, in _inlineCallbacks
> result = g.send(result)
> File "/usr/lib/python2.7/dist-packages/juju/state/hook.py", line 63, in
> _resolve_name
> unit_id = self._topology.get_service_unit_id_from_name(unit_name)
> File "/usr/lib/python2.7/dist-packages/juju/state/topology.py", line
> 262, in get_service_unit_id_from_name
> service_name, unit_sequence_id = unit_name.split("/")
> exceptions.ValueError: need more than 1 value to unpack
>
> ** Affects: juju
> Importance: High
> Status: New
>
> --
> You received this bug notification because you are subscribed to juju.
> https://bugs.launchpad.net/bugs/1020635
>
> Title:
> cannot store yaml in relation settings
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1020635/+subscriptions
>