bug in deploymentpropertiesmodifier

Jiri Vanek jvanek at redhat.com
Wed Sep 2 13:35:53 UTC 2015


On 09/01/2015 07:22 PM, Andrew Azores wrote:
> On 01/09/15 08:39 AM, Jiri Vanek wrote:
>> Hello!
>>
>> If you get back to loop, may you fx one error?
>>
>>
>> deployment properties may contains commented-out values
>>
>> #Netx deployment configuration
>> #Mon Aug 31 13:20:09 CEST 2015
>> #deployment.manifest.attributes.check=ALL
>> deployment.security.level=ALLOW_UNSIGNED
>> deployment.manifest.attributes.check=NONE
>>
>> When deployment properties modifier is applied,
>> then it seem to me that it uncomment value, as I have seen during processing above file changed to:
>>
>> #Netx deployment configuration
>> #Mon Aug 31 13:20:09 CEST 2015
>> deployment.manifest.attributes.check=ALL
>>
>> deployment.security.level=ALLOW_UNSIGNED
>> deployment.manifest.attributes.check=NONE
>>
>> Thats definitely incorrect. MAy you verify and fix?
>>
>> Thanx!
>>
>>
>> J.
>>
>>
>>
>
> I'm not sure how to get the tests-extensions-tests for this to run to verify that the changes are

Wel... create faked file with commented vlaues and verify, that after deploymentpropertiesmodifier 
apply the commented ones are not changed, but uncommenrted ones are?

And after restroe, that commented liens are still there as they were, and uncommented too?

from quick glance your test is doing something like that.....
> correct, but it looks like it probably works properly from manual testing. All comments in the file
> get remembered and removed, and then reinserted at the end of the file on restore. They go at the
> end just to be sure that the property restore process doesn't accidentally restore values into a
> commented line - it isn't the most elegant solution, but it should work.
>

Hi!

thanx for quick takover.

  I got idea:
Why we are using text substitution here? (yes it might be handy, so this 
deploymentpropertiesmodifier will not die)
But - what about laoding it as Configuration Instance, clone as for restoration purpose,  make 
type-safe change and store. DeploymentConfig is already handling comments.

Only drawback I see is, that deployment config might be merged from system-wide. Thught?

As for your fix - impl is ok. But maybe one imporvement.

Don't save commented out lines to buffer, but rather save whole file as String, and then save that 
string again.

I think it is little bit safer. And the restored file  will really be exact ...

hmm?

J.


More information about the distro-pkg-dev mailing list