Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify relative paths into configuration file? #2

Open
giampaolo opened this issue Feb 19, 2014 · 2 comments
Open

How to specify relative paths into configuration file? #2

giampaolo opened this issue Feb 19, 2014 · 2 comments

Comments

@giampaolo
Copy link
Contributor

Hello.
I have a configuration file looking like this:

<runner>
    daemon on
    program easymonitor
    socket-name _zdaemon.sock
    transcript myapp.log
</runner>

I would like "socket-name" and "transcript" paths to be relative compared to where the configuration file lives.
As zdaemon is right now, in case a relative path is specified, os.getcwd() is assumed.
That means that I'm forced to specify an absolute path which of course is valid on my machine but may change somewhere else (production, staging. etc.).

I think there should a way to override this behavior, either by providing some kind of templating systems (e.g. "transcript {{HERE}}/myapp.log") or by assuming os.path.abspath(os.path.dirname(file)) in case of a relative path.

Thoughts?

@giampaolo
Copy link
Contributor Author

Up?

@mgedmin
Copy link
Member

mgedmin commented Apr 15, 2015

Personally I think it's a good idea.

zdaemon uses ZConfig to read and interpret the config file. I think this bug should be reassigned to ZConfig. Something similar to zopefoundation/ZConfig#2 perhaps, with ${CONFFILEPATH} or better syntax?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants