[ 
https://issues.apache.org/jira/browse/AMBARI-19653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15832287#comment-15832287
 ] 

Alejandro Fernandez commented on AMBARI-19653:
----------------------------------------------

[~LesTR], if I understood this correctly, you plan to change to change 
check_package_condition from a static method to an instance method?
However, in install_packages.py, how will you construct a component object that 
inherits from script?


> Unable to specify condition function per package in custom service
> ------------------------------------------------------------------
>
>                 Key: AMBARI-19653
>                 URL: https://issues.apache.org/jira/browse/AMBARI-19653
>             Project: Ambari
>          Issue Type: Bug
>    Affects Versions: 2.4.2
>            Reporter: Lukas Drbal
>            Priority: Blocker
>
> I have custom service which has more components. Each component is installed 
> from separate deb package.
> In ambari 2.2 we was able to use param exclude_packages in calling method 
> install_packages.
> This behaviour was changed in 2.4 release - was replaced by condition tag in 
> metainfo.xml but there is hardcoded class for this condition functions [1].
> For this all installation ends with error: 
> "resource_management.core.exceptions.Fail: Condition with name 
> 'should_install_confluent_supervisor', when installing package supervisor. 
> Please check package_conditions.py."
> Workaround is copy install_packages method into my component script and 
> replace that hardcoded class. Otherwise i must hack ambari source code.
> Suggested solution:
> 1. remove static annotation from check_package_condition method
> 2. change that hardcoded Script to self
> 3. allow use self in searching for condition method
> In this solution every component script can define own condition function. If 
> you agree with this, i'll prepare patch.   
> [1] 
> https://github.com/apache/ambari/blob/release-2.4.2/ambari-common/src/main/python/resource_management/libraries/script/script.py#L556



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to