Monday, 2024-06-17

d1nuc0mHi all, I'm having a strange problem - if I set USER_MENU_LINKS at the end of /etc/openstack-dashboard/local_settings it works, but if I put the same snippet in a .py file in /etc/openstack-dashboard/local_settings.d, it does not work... What am I missing?12:46
opendevreviewTobias Urdin proposed openstack/horizon master: Delete container show duplicate toast notifications  https://review.opendev.org/c/openstack/horizon/+/92209412:46
pas-ha[m]d1nuc0m: looking at the code, it expects files in the local_settings.d folder to have .conf extension, not .py12:51
pas-ha[m]https://opendev.org/openstack/horizon/src/branch/master/openstack_dashboard/settings.py#L236-L23712:51
d1nuc0mpas-ha[m], thanks but this  does not seem to have an effect12:58
d1nuc0mThis is the actual file content https://paste.opendev.org/show/bQTBkhph63F5hQTfahLn/12:59
d1nuc0mTaken from docs (that btw still tell to use .py extension) https://docs.openstack.org/horizon/latest/configuration/settings.html#user-menu-links12:59
pas-ha[m]seems like that at some point there was attempt to move to oslo.config based configuration instead of Djang-based py-files... may be both should be usable?.. 🤷13:03
d1nuc0mI don't know, RN I am not able to make it work, nor .py nor .conf13:04
d1nuc0mpas-ha[m], interesting enough, there are other .py files in  /etc/openstack-dashboard/local_settings.d with a content like this https://paste.opendev.org/show/bGx8zwriHSWTJHu498pk/13:12
pas-ha[m]ok, so py should work. i'd check if any of them re-define USER_MENU_LINKS and is loaded alphabetically after your file..13:13
d1nuc0mAlready checked with no luck...13:17
d1nuc0mThere are also example file in horizon repo (https://opendev.org/openstack/horizon/src/branch/master/openstack_dashboard/local/local_settings.d)13:19
tkajinamd1nuc0m, I suspect you need "from django.utils.translation import gettext_lazy as _"14:52
tkajinamhttps://github.com/openstack/horizon/blob/master/openstack_dashboard/settings.py#L269-L28014:52
tkajinamprobably you first have to check if that "Can not exec settings snippet" error message is found or not14:53
tkajinamI mean you have to add that import line at the top of that file14:55
d1nuc0mtkajinam, thanks, added it on top, but still nothing, also searched for the errors in log and nothing14:56
tkajinamd1nuc0m, did you restart apache/httpd after you added the line ?14:57
d1nuc0myes14:57
tkajinamhm14:57
tkajinammaybe I'd try messing the syntax (like removing the ] at the end) and see if the error log appears14:58
tkajinamto understand if the file is loaded without error14:59
d1nuc0mNo, there is no error, searched with grep "Can not exec settings snippet" -Ri /var/log/*15:01
d1nuc0mIt's like the file is being ignored15:01
d1nuc0mBut it's owned by apache:apache and has 640 permissions like the other oens15:01
d1nuc0m*ones15:02
tkajinamd1nuc0m, what's the distribution/install method you use15:06
d1nuc0mtkajinam, RDO15:09
d1nuc0mOn EL915:09
d1nuc0mAnyway gotta go, will work on it next days, maybe a pause will give a different POV15:10
d1nuc0mThank you for your help :)15:11

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!