Forum: CFEngine Help
Subject: Re: set_config_values() does different things depending on original 
value of config variable in file
Author: nickanderson
Link to topic: https://cfengine.com/forum/read.php?3,26379,26380#msg-26380

I was able to reproduce the behavior. I would consider it a bug in 
set_config_values.


replace_patterns:
  # If the line is there, maybe commented out, uncomment and replace with
  # the correct value
  "^\s*($(index)\s+(?!$($(v)[$(index)])).*|# ?$(index)\s+.*)$"
    replace_with => value("$(index) $($(v)[$(index)])"),
    classes => always("replace_attempted_$(cindex[$(index)])");


I think there needs to be a $ in the lookahead.

Try this (untested)


replace_patterns:
  # If the line is there, maybe commented out, uncomment and replace with
  # the correct value
  "^\s*($(index)\s+(?!$($(v)[$(index)])$).*|# ?$(index)\s+.*)$"
    replace_with => value("$(index) $($(v)[$(index)])"),
    classes => always("replace_attempted_$(cindex[$(index)])");


_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to