On Tue, Jul 17, 2012 at 11:45 PM, Roberto De Ioris <[email protected]> wrote:
>
>> hello,
>>
>> i'm working on a self-managing queue-like system over RabbitMQ, and
>> hence using the AMQP emperor.  i've never been a big fan of using INI
>> files, so this time i tried JSON instead ... but they do not appear to
>> handle string interpolation of $(ENVIRONMENT) args? i didn't try other
>> configs yet, or other interpolation types like @(file) or
>> %(identifier), but i'm assuming the don't work either :-(
>>
>> lately i've been favoring exec:// configs to handle most things, but i
>> still like using, for example:
>>
>> virtualenv = $(VIRTUAL_ENV)
>>
>> ... esp. in development.  so, my question is: are INIs the only config
>> type supporting interpolation? tried 1.2.4 and HEAD.
>>
>> thanks!
>
> Interpolations are managed out of config file parsers, so they must work
> independently by it:
>
> { "uwsgi": {
>                 "socket": "@(pippo)",
>                 "print": "$(PATH)"
>         }
> }
>
> works for me

that's what i thought too ... and what i recall from previous readings
into the code ... it *should* work.  your example however *isn't*
working for me:

===========================
# ./uwsgi --json /dev/stdin --show-config <<'EOF'
> { "uwsgi": {
>                 "socket": "@(pippo)",
>                 "print": "$(PATH)"
>         }
> }
> EOF
[uWSGI] getting JSON configuration from /dev/stdin
$(PATH)

;uWSGI instance configuration
[uwsgi]
json = /dev/stdin
show-config = true
socket = @(pippo)
print = $(PATH)
;end of configuration

*** Starting uWSGI 1.3-dev (64bit) on [Thu Jul 19 01:18:51 2012] ***
compiled with version: 4.7.1 on 19 July 2012 01:12:51
os: Linux-3.4.4-3-ARCH #1 SMP PREEMPT Tue Jul 3 14:36:44 UTC 2012

[ ... cont. uWSGI output ... ]
===========================

... this is after fresh pull/build of HEAD, with:

# pacman -Ss jansson
community/jansson 2.3-1 [installed]
    C library for encoding, decoding and manipulating JSON data

... same exact result in 1.2.4, but here is another example:

===========================
# ./uwsgi --json /dev/stdin --show-config <<<'{"uwsgi":{"print":"$(HOME)"}}'
[uWSGI] getting JSON configuration from /dev/stdin
$(HOME)

;uWSGI instance configuration
[uwsgi]
json = /dev/stdin
show-config = true
print = $(HOME)
;end of configuration

[ ... cont. uWSGI output ... ]
===========================

... same setup works fine if i use INI (a little messy):

===========================
# ./uwsgi --ini /dev/stdin --show-config <<<$'[uwsgi]\nprint=$(HOME)'
[uWSGI] getting INI configuration from /dev/stdin
/home/anthony

;uWSGI instance configuration
[uwsgi]
ini = /dev/stdin
print = /home/anthony
show-config = true
;end of configuration

[ ... cont. uWSGI output ... ]
===========================

... am i doing something obviously wrong here?

-- 

C Anthony
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to