mozilla/configman — Issue #19: Exported value is incorrect
Author: AdrianGaudebert
Created: 2012-01-09 18:02:09+00:00
State: open

I have the following case:

from configman import Namespace
from configman.converters import class_converter

def string_to_classes_list(source):
return [class_converter(x.strip()) for x in source.split(",")]

# ...

required_config.add_option("services_list",
doc="a list of Web services to run",
from_string_converter=string_to_classes_list)

When I call my script like so:

``python my_app.py --services_list=socorro.middleware.search_service.Search,socorro.middleware.versions_info_service.VersionsInfo --admin.dump_conf=conf.ini``

I get the following for ``services_list``:

# name: services_list
# doc: a list of Web services to run
# converter: string_to_classes_list
services_list=[, ]

As you can see, the ``services_list`` key content is not what I would expect it to be. I would expect it to be something like ``socorro.middleware.search_service.Search, socorro.middleware.versions_info_service.VersionsInfo``.

I guess that behavior is expected, but I am unsure it is right. Is there a way to write a non-converted value to the output? Especially when using a complex converter.