Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #8826: Technique Editor is broken in Rudder 3.2.5 #416

Conversation

VinceMacBuche
Copy link
Member

@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the bug_8826/technique_editor_is_broken_in_rudder_3_2_5 branch from b8ec4bf to 8690099 Compare August 9, 2016 09:27
@@ -324,7 +324,7 @@ def generate_rudder_reporting(technique):
key_value_canonified = regex.sub("_", key_value)

class_prefix = generic_method["class_prefix"]+"_"+key_value_canonified
logger_rudder_call = '"dummy_report" usebundle => log_rudder("' + generic_method['name'] + ' ' + key_value + ' if ' + method_call['class_context'] + '", "' + class_prefix +'")'
logger_rudder_call = '"dummy_report" usebundle => log_rudder("' + generic_method['name'] + ' ' + key_value + ' if ' + method_call['class_context'] + '", "' + class_prefix +'", "", "")'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last two arguments of log_rudder are actually important. I'm not sure how well the method would cope with the last (which is supposed to be a slist) being an empty string. Therefore, I think now is a good time to get ncf-builder to include the boilerplate to generate them in all methods, just like we do in the methods ncf provides.

That simply involves adding this code to the top of all generated bundles (before "methods:") (like in ncf.py):

  vars:
    "promisers"          slist => { @{this.callers_promisers}, cf_null }, policy => "ifdefined";
    "class_prefix"      string => canonify(join("_", "promisers"));
    "args"               slist => { };

(obviously, args will be empty for now since ncf-builder doesn't support creating techniques with arguments, but would later contain the list of arguments)

Then, this call would instead become:

logger_rudder_call = '"dummy_report" usebundle => log_rudder("' + generic_method['name'] + ' ' + key_value + ' if ' + method_call['class_context'] + '", "' + class_prefix +'", "${class_prefix}", @{args})'

@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the bug_8826/technique_editor_is_broken_in_rudder_3_2_5 branch from 8690099 to de77304 Compare August 9, 2016 14:39
@jooooooon
Copy link
Member

Looks good to me, but you mentioned it may not work. Did you test?

@VinceMacBuche
Copy link
Member Author

I tested and it works so ...

@jooooooon
Copy link
Member

Great!

@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit de77304 into Normation:master Aug 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants