[
https://issues.apache.org/jira/browse/AMBARI-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13698001#comment-13698001
]
Nate Cole commented on AMBARI-2542:
-----------------------------------
* Yes, it's in performStaticInjection(), even though it is not technically
static. I REALLY wanted to do it init(), but that doesn't work because the
database layer has not yet been injected (the DAO is, but the entity manager is
not). Changing the initialization order to do the database layer first gave me
inconsistent results. Additionally, the AmbariMetaInfo class is instantiated
directly with either a configuration or two File objects, not always by Guice.
By using helper methods, the only way to change the URL is when you know the
DAO is available. Otherwise we need a new kind of init() that takes a known
DAO, which leads to a lot of checking along the way to know if it's null or
not. The intent was to keep database updates to a minimum. If you have any
alternative suggestions, they would be greatly appreciated.
* DefaultBaseUrl is a backup of the baseurl. It is null to start with (only
base_url exists). Only if the newBaseUrl is equal to the default (the backup)
will the default become null (unless you think they should be the same).
* For the inner if, the default can only be set if it has never been set
before. You can change the URL 10 times if you want, but default_base can only
ever be the original value from the XML file.
> Custom Repo URL cannot be set when non-root
> -------------------------------------------
>
> Key: AMBARI-2542
> URL: https://issues.apache.org/jira/browse/AMBARI-2542
> Project: Ambari
> Issue Type: Bug
> Components: controller
> Affects Versions: 1.2.5
> Reporter: Nate Cole
> Assignee: Nate Cole
> Fix For: 1.2.5
>
> Attachments: AMBARI-2542.patch
>
>
> The first iteration for creating custom repo URL persisted the new URL to
> disk. This poses a problem when running Ambari as non-root because the file
> system is owned by root. Change the implementation to save the override in
> the metainfo table.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira