Re: [viewvc-dev] [PATCH] mod_python configuration
"C. Michael Pilato" <[email protected]> Thu, 15 Sep 2011 12:51:15 -0400
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.devel |
|---|---|
| Organization | CollabNet, Inc. |
| Message-ID | <[email protected]> |
On 09/15/2011 11:19 AM, Alon Bar-Lev wrote:
>> That said, in reviewing your patch, it occurs to me that the code in
>> viewvc.load_config() probably shouldn't use os.environ() to check for that
>> variable, but (if a 'server' is provided') should use server.getenv()
>> instead. That way, the appropriate environment-checking function for the
>> deployment type (mod_python, CGI, IIS, etc.) is used.
>>
>> Would you be willing to explore this idea a bit to see if it makes sense?
>
> Well,
>
> SetEnv does not work in mod_python, at least not in my setup.
How do you know that SetEnv doesn't work for mod_python? How are you
testing that?
> So we need something like:
>
> if pathname is None:
> pathname = (server.get_options()["org.viewvc.conf_file"] <----
> or os.environ.get("VIEWVC_CONF_PATHNAME")
> or os.environ.get("VIEWCVS_CONF_PATHNAME")
> or os.path.join(os.path.dirname(os.path.dirname(__file__)),
> "viewvc.conf"))
>
> However
>
> 1. The python throws and exception if element within hash is not found
> (I expect it to return None...) so I leave it for you...
server.get_options().get("org.viewvc.conf_file") returns None of the key
doesn't exist in the dictionary/hash.
> 2. Correct me if I am wrong but this does not overrides the default
> within file, it does set if config is null, and it never is as the
> viewvc-install sets CONF_PATHNAME to none null.
> I expect environment / option to override the hard coded anyway, so
> remove the "if pathname is None:" (and of course un-indent...).
You are correct. I read that wrongly.
> 3. Environment(or options) should be documented in INSTALL.... A
> complete <Directory sample would be nice! :)
Fair enough. :-)
--
C. Michael Pilato <[email protected]>
CollabNet <> www.collab.net <> Distributed Development On Demand
------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4251&dsMessageId=2839266
To unsubscribe from this discussion, e-mail: [[email protected]].
signature.asc
(application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk5yLQMACgkQokEGqRcG/W4f6ACgwKwBXMBEYa8HlfomOil/SHgq LA4AoI3Z0cQxGxvfqKwqT/MjXWZUGv+p =6fcw -----END PGP SIGNATURE-----