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 #7461: classes_* methods should refuse to copy classes to a prefix which is an empty string #272

Conversation

jooooooon
Copy link
Member

@@ -37,9 +37,10 @@ bundle agent test
"ph2" usebundle => file_ensure_lines_absent("${init.file}", "sample one"); # should get success
"ph3" usebundle => file_ensure_lines_absent("/dev/zero", "sample three"); # should get failed

"ph1" usebundle => _classes_copy("file_ensure_lines_absent_${init.file_canon}","global_classA");
"ph2" usebundle => _classes_copy("file_ensure_lines_present_${init.file_canon}","global_classB");
Copy link
Member

Choose a reason for hiding this comment

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

Why do you change the ordering ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the original ordering made no sense. Now, the order matches the order of the calls above.

@jooooooon
Copy link
Member Author

PR updated

@jooooooon jooooooon force-pushed the bug_7461/classes_methods_should_refuse_to_copy_classes_to_a_prefix_which_is_an_empty_string branch from 80690bf to db3c3d0 Compare November 24, 2015 16:21
@peckpeck
Copy link
Member

Good, merging

peckpeck added a commit that referenced this pull request Nov 24, 2015
…d_refuse_to_copy_classes_to_a_prefix_which_is_an_empty_string

Fixes #7461: classes_* methods should refuse to copy classes to a prefix which is an empty string
@peckpeck peckpeck merged commit 285c09c into Normation:v0.x Nov 24, 2015
@@ -38,6 +39,10 @@ bundle agent _classes_success(class_prefix)
"local_${suffix}"
string => "${class_prefix}_${suffix}",
classes => always("${class_prefix}_${suffix}");

classes:
"destination_exists" not => strcmp("${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.

shouldn't it report a warning if an empty string is passed?

Copy link
Member

Choose a reason for hiding this comment

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

In master we use this property in every generic method so that calls don't fail when this.caller_promisers doesn't exist. So it could be a warning, but not in the general case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants