Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 885823

Summary: please implement a redirection-servlet as the solution for the localized-documentation fallback mechanism (instead of docs package symlinks)
Product: Red Hat Enterprise Virtualization Manager Reporter: Einav Cohen <ecohen>
Component: ovirt-engine-webadmin-portalAssignee: Alexander Wels <awels>
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Belka <jbelka>
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: dyasny, ecohen, iheim, juan.hernandez, Rhev-m-bugs, sgordon, sgrinber, ykaul
Target Milestone: ---   
Target Release: 3.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ux
Fixed In Version: sf17.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-11 08:17:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 948448, 966721    

Description Einav Cohen 2012-12-10 17:42:45 UTC
Current solution for localized-documentation-fallback is implemented by symlinks.

i.e., when only English documentation is installed, the Japanese doc files, for example, are there, implemented as symlinks to the enlish doc files.

[Once the Japanese documentation package is also installed, the symlinks are/should be replaced with the actual newly-deployed Japanese doc files]

Due to the problematic nature of handling symlinks in the yum install/update process, we want to implement the fallback mechanism via a redirection servlet.

I.e. when requesting a localized documentation file that doesn't exist - a redirection servlet would fallback to the parallel default (English) documentation file.
[and the default (English) docs package (or any other docs package, for that matter) wouldn't have to contain symlinks anymore]

Comment 1 Stephen Gordon 2012-12-10 20:11:52 UTC
(In reply to comment #0)
> [Once the Japanese documentation package is also installed, the symlinks
> are/should be replaced with the actual newly-deployed Japanese doc files]

To clarify for bystanders this bit proved to be impossible to do "in place". When RPM evaluates the incoming filelist it does so against the filesystem that still has the symlink, as a result it determines the new rhevm-doc-ja-JP package conflicts with the rhevm-doc package.

It's possible to get around this using %pretrans (risky!) but the problem with this approach is that only works if you are installing the package directly with RPM. YUM doesn't run the %pretrans scriptlets when it runs the pre-transaction checks (because they can perform tasks that it can't roll back) and thus still detects the conflict if you are switching a symlink to a directory.

Ultimately this became a non-issue for us because in the final build I had to rename the top level folder from ja-JP to ja to match the UI mapping (thus "removing" all the symlinks and "adding" all the directories in a different location) but as a result of this adventure I would *not* use the symlink approach for any further language packs.

Comment 2 Alexander Wels 2012-12-14 13:26:27 UTC
Changes committed and available for review here:
http://gerrit.ovirt.org/#/c/10060/

Comment 3 Alexander Wels 2012-12-14 15:34:09 UTC
(In reply to comment #2)
I abandoned that patch set due to it being dependent on another one I didn't want it to be dependent on. The new patch set is:

http://gerrit.ovirt.org/#/c/10065/

Comment 9 Jiri Belka 2013-05-03 13:48:07 UTC
ok, sf15.

Comment 12 Jiri Belka 2013-05-14 12:42:22 UTC
It's not working in IE (8,9,10).

Comment 13 Alexander Wels 2013-05-15 14:13:16 UTC
The problem was a bug in the locale detection code using the URL path. Normally the code tries to use the referrer to determine the locale, but some browsers don't pass the referrer and it falls back on the path. There was a bug where it wasn't handling a '-' properly. So having fr-FR in the path would fail, where having fr_FR would work fine.

Comment 14 Jiri Belka 2013-05-23 07:59:17 UTC
ok, sf17.1.

Comment 15 Itamar Heim 2013-06-11 08:17:25 UTC
3.2 has been released