You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by yogu13 <yo...@gmail.com> on 2017/04/08 17:29:11 UTC
Feature configurations do not update existing property as part of
etc
Hi,
I noticed that the below configuration added as part of my custom feature
does not have any effect if etc/com.foo.bar.cfg has myProperty already
defined. I was hoping i could use the config to update a property which is
already defined and available
<config name="com.foo.bar">
myProperty = myValue
</config>
I stumbled across this scenario when i wanted to reset
aries.transaction.recoverable to false which is now turned on (set to true)
by default in karaf.
In case config updation is not supported by config tag can this support be
added ?
Let me know.. I can try and provide a PR
Regards,
-Yogesh
--
View this message in context: http://karaf.922171.n3.nabble.com/Feature-configurations-do-not-update-existing-property-as-part-of-etc-tp4050074.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.
Re: Feature configurations do not update existing property as part of
etc
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
if you use <confgfile/> instead of <config/>, you can use the override flag.
I think it makes sense to support override flag for the <config/> element as it
now creates the cfg file.
I will create a Jira about that.
Regards
JB
On 04/09/2017 10:25 PM, Achim Nierbeck wrote:
> Hi Yogesh,
>
> you only can append existing configurations, but not replace. [1]
> This is by design, as already existing files can't be differentiate
> between, already accustomed or needs to be "patched".
>
> Regards, Achim
>
> [1] -
> https://github.com/apache/karaf/blob/master/features/core/src/main/resources/org/apache/karaf/features/karaf-features-1.4.0.xsd#L194
>
>
> 2017-04-08 19:29 GMT+02:00 yogu13 <yo...@gmail.com>:
>
>> Hi,
>>
>> I noticed that the below configuration added as part of my custom feature
>> does not have any effect if etc/com.foo.bar.cfg has myProperty already
>> defined. I was hoping i could use the config to update a property which is
>> already defined and available
>>
>> <config name="com.foo.bar">
>> myProperty = myValue
>> </config>
>>
>> I stumbled across this scenario when i wanted to reset
>> aries.transaction.recoverable to false which is now turned on (set to true)
>> by default in karaf.
>>
>> In case config updation is not supported by config tag can this support be
>> added ?
>>
>> Let me know.. I can try and provide a PR
>>
>> Regards,
>> -Yogesh
>>
>>
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.
>> com/Feature-configurations-do-not-update-existing-property-
>> as-part-of-etc-tp4050074.html
>> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>>
>
>
>
--
Jean-Baptiste Onofr�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Feature configurations do not update existing property as part of
etc
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
no, override will take the lead on append.
Regards
JB
On 04/15/2017 08:26 PM, yogu13 wrote:
> echoing what i mentioned as part of JIRA
>
> considering override="true" needs to be added, config element also supports
> append="true". Just wondering using append="true" and override="true"
> together would make any sense?
>
> <config name="com.foo.bar" append="true" override="true">
> myProperty = myValue
> </config>
> With above as an example would it mean if myProperty is found it would get
> overwritten with value as "myValue" and if the property is not found then
> gets appended to the config file.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Feature-configurations-do-not-update-existing-property-as-part-of-etc-tp4050074p4050162.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Feature configurations do not update existing property as part
of etc
Posted by yogu13 <yo...@gmail.com>.
echoing what i mentioned as part of JIRA
considering override="true" needs to be added, config element also supports
append="true". Just wondering using append="true" and override="true"
together would make any sense?
<config name="com.foo.bar" append="true" override="true">
myProperty = myValue
</config>
With above as an example would it mean if myProperty is found it would get
overwritten with value as "myValue" and if the property is not found then
gets appended to the config file.
--
View this message in context: http://karaf.922171.n3.nabble.com/Feature-configurations-do-not-update-existing-property-as-part-of-etc-tp4050074p4050162.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.
Re: Feature configurations do not update existing property as part
of etc
Posted by yogu13 <yo...@gmail.com>.
Hello JB,
Thats correct <configfile/> should work, I tried it but as far as i
recollect it didn't work, I will try and update you with the actual reason
for why it didnt work ( I do not remember it as its been few days :( ). Also
we do not consider this as optimal solution for us as we will have to
maintain a copy of aries transaction file and keep upgrading incase of any
additions / updates to the original file provided by aries.
Thank you for raising the JIRA ticket!
Regards,
-Yogesh
--
View this message in context: http://karaf.922171.n3.nabble.com/Feature-configurations-do-not-update-existing-property-as-part-of-etc-tp4050074p4050088.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.
Re: Feature configurations do not update existing property as part of
etc
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
As said, as a workaround, you can use <configfile/> with override.
Regards
JB
On 04/10/2017 06:34 AM, yogu13 wrote:
> Hello Achim,
>
> Thank you for your reply..
>
> But does the group feel such a feature would be useful ? If yes then i can
> try to provide a fix.
>
> Right now I am not able to achieve automation and instead have a manual step
> (of editing the transaction file) after deploying my custom KAR. If this
> feature is implemented it could help in scenarios like I am facing. However
> implementing this feature has its downside as well especially since multiple
> KAR files can be deployed into Karaf and each KAR can end up toggling the
> properties.
>
> Regards,
> -Yogesh
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Feature-configurations-do-not-update-existing-property-as-part-of-etc-tp4050074p4050084.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Feature configurations do not update existing property as part
of etc
Posted by yogu13 <yo...@gmail.com>.
Hello Achim,
Thank you for your reply..
But does the group feel such a feature would be useful ? If yes then i can
try to provide a fix.
Right now I am not able to achieve automation and instead have a manual step
(of editing the transaction file) after deploying my custom KAR. If this
feature is implemented it could help in scenarios like I am facing. However
implementing this feature has its downside as well especially since multiple
KAR files can be deployed into Karaf and each KAR can end up toggling the
properties.
Regards,
-Yogesh
--
View this message in context: http://karaf.922171.n3.nabble.com/Feature-configurations-do-not-update-existing-property-as-part-of-etc-tp4050074p4050084.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.
Re: Feature configurations do not update existing property as part of etc
Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Yogesh,
you only can append existing configurations, but not replace. [1]
This is by design, as already existing files can't be differentiate
between, already accustomed or needs to be "patched".
Regards, Achim
[1] -
https://github.com/apache/karaf/blob/master/features/core/src/main/resources/org/apache/karaf/features/karaf-features-1.4.0.xsd#L194
2017-04-08 19:29 GMT+02:00 yogu13 <yo...@gmail.com>:
> Hi,
>
> I noticed that the below configuration added as part of my custom feature
> does not have any effect if etc/com.foo.bar.cfg has myProperty already
> defined. I was hoping i could use the config to update a property which is
> already defined and available
>
> <config name="com.foo.bar">
> myProperty = myValue
> </config>
>
> I stumbled across this scenario when i wanted to reset
> aries.transaction.recoverable to false which is now turned on (set to true)
> by default in karaf.
>
> In case config updation is not supported by config tag can this support be
> added ?
>
> Let me know.. I can try and provide a PR
>
> Regards,
> -Yogesh
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.
> com/Feature-configurations-do-not-update-existing-property-
> as-part-of-etc-tp4050074.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>
--
Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
Software Architect / Project Manager / Scrum Master