dots in charm names (shelr.tv)

Abel Deuring abel.deuring at canonical.com
Tue Mar 26 15:47:25 UTC 2013


On 26.03.2013 15:41, Gustavo Niemeyer wrote:
> On Tue, Mar 26, 2013 at 11:35 AM, Abel Deuring
> <abel.deuring at canonical.com> wrote:
>> well, we retrieve the data about charms from Launchpad. My question was
>> simply: Is it worth to change charmworld so that it can properly deal
>> with the name shelr.tv, or should the name be fixed because it might
>> also be unusable in juju-core?
> 
> That's exactly the point I'm trying to make: everything that is not in
> the charm store is not usable. It should filter based on whether the
> charm exists or not, rather than whether it can import it from
> Launchpad directly.

Divergence betwen LP and the charm store might be an issue (though
charmworld checks the main store too), but that's not my main point,
neither is importing from LP an issue with shelr.tv. The problem we have
with this charm is that we use MongoDB records like {'_id':
'cs:<long-path>/shelr.tv', ...}

i.e., the charm name is used in the ID. But dots should not be used in
MongoDB keys because queries like collection.find({'a.b': 'c'}) search
for records like {'a': {'b': 'c'}}. And more recent versions of pymongo
raise an error when you try to insert or update a record with a dot in a
key.

> 
> There's an existing API in the charm store that gives you [1] precise
> information about what exists, including the actual digest that was
> imported.

ok, one step forward:

https://store.juju.ubuntu.com/charm-info?charms=cs:precise/shelrtv&stats=0

returns some reasonable data (and a related charm is indeed available), but

https://store.juju.ubuntu.com/charm-info?charms=cs:precise/shelr.tv&stats=0

returns an error:

{"cs:precise/shelr.tv":{"revision":0,"errors":["charm URL has invalid
charm name: \"cs:precise/shelr.tv\""]}}

So we have a possible name inconsistency between LP and the charm
store... Can we assume that dots (and perhaps other other symbols) are
simply removed when an LP product name is mapped to a charm name? (A
quick "grep -r shelrtv" in a local copy of
lp:~charmers/charms/precise/shelr.tv/trunk returned no results.)

Abel



More information about the Juju mailing list