JNPRAutomate / fluent-plugin-juniper-telemetry

Fluentd plugin for Juniper telemetry
Apache License 2.0
21 stars 13 forks source link

accidentally destructive method? #1

Closed ytti closed 8 years ago

ytti commented 8 years ago

https://github.com/JNPRAutomate/fluent-plugin-juniper-telemetry/blob/master/lib/fluent/plugin/parser_juniper_analyticsd.rb#L113

this method modifies name, clearly intention was to keep name unchanged.

dgarros commented 8 years ago

Hi

it's only used for flat output (Statsd type) in this mode some characters are forbidden like otherwise it will not work Unless I missed something, happy to revisit this one if you have a better proposal

Thanks Damien

ytti commented 8 years ago

My point is you're doing

foo = bar foo.modify # you are in-place modifying object_id shared by foo and bar return foo # return the common object_id

But you're actually modifying bar as well here. And it looks like the method that intention was not to modify the method argument.