check-url: Quote $URL in -z check
authorKirill Smelkov <kirr@nexedi.com>
Wed, 25 Nov 2015 12:43:33 +0000 (15:43 +0300)
committerKirill Smelkov <kirr@nexedi.com>
Wed, 25 Nov 2015 14:24:29 +0000 (17:24 +0300)
commitc1ecf01796cc206790a2a567774f6f5eed13b0f9
tree2ee46556c07afe48eb550d1b04c1cb70217c08b6
parent35024175870dd27bd15b62cf9e72acf1985aa3ef
check-url: Quote $URL in -z check

If one wants to check URLs on UNIX-sockets, there is no full URL schema
in curl for this, but the following has to be used instead:

    curl --unix-socket /path/to/socket http:/<url-path>

For this to work, one can do e.g. the following trick:

    [promise-unicorn]
    recipe  = slapos.cookbook:check_url_available
    url     = --unix-socket ${unicorn:socket}  http:/

but then generated promise scripts fails this way:

    ./etc/promise/unicorn: line 7: [: too many arguments

via quoting $URL in emptiness check we can support both usual URLs and
urls with --unix-socket prepended trick.

/reviewed-by @cedric.leninivin  (on nexedi/slapos!31)
slapos/recipe/check_url_available/template/check_url.in