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

[collectd] rename log_parser to logparser #930

Merged
merged 1 commit into from
Apr 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#https://wiki.opnfv.org/display/fastpath/Logparser+plugin+HLD
class collectd::plugin::log_parser (
class collectd::plugin::logparser (
$ensure = 'present',
Array[Hash[String[1],Collectd::LOG_PARSER::Logfile]] $logfile = [{
Array[Hash[String[1],Collectd::LOGPARSER::Logfile]] $logfile = [{
'/var/log/syslog' => {
'firstfullread' => false,
'message' => [
Expand Down Expand Up @@ -66,9 +66,9 @@
){
include collectd

collectd::plugin { 'log_parser':
collectd::plugin { 'logparser':
ensure => $ensure,
content => epp('collectd/plugin/log_parser.conf.epp', {
content => epp('collectd/plugin/logparser.conf.epp', {
'logfile' => $logfile,
}),
order => '06',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper'

describe 'collectd::plugin::log_parser', type: :class do
describe 'collectd::plugin::logparser', type: :class do
on_supported_os(baseline_os_hash).each do |os, facts|
context "on #{os} " do
let :facts do
Expand All @@ -11,20 +11,20 @@

options = os_specific_options(facts)
context ':ensure => present, default params' do
it "Will create #{options[:plugin_conf_dir]}/06-log_parser.conf" do
is_expected.to contain_file('log_parser.load').with(
it "Will create #{options[:plugin_conf_dir]}/06-logparser.conf" do
is_expected.to contain_file('logparser.load').with(
ensure: 'present',
path: "#{options[:plugin_conf_dir]}/06-log_parser.conf"
path: "#{options[:plugin_conf_dir]}/06-logparser.conf"
)
end
end

context ':ensure => log parser created with default values' do
default_fixture = File.read(fixtures('plugins/logparser.conf.default'))
it "Will create #{options[:plugin_conf_dir]}/06-log_parser.conf" do
is_expected.to contain_file('log_parser.load').with(
it "Will create #{options[:plugin_conf_dir]}/06-logparser.conf" do
is_expected.to contain_file('logparser.load').with(
ensure: 'present',
path: "#{options[:plugin_conf_dir]}/06-log_parser.conf",
path: "#{options[:plugin_conf_dir]}/06-logparser.conf",
content: default_fixture
)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/plugins/logparser.conf.default
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Generated by Puppet
<LoadPlugin log_parser>
<LoadPlugin logparser>
Globals false
</LoadPlugin>

<Plugin log_parser>
<Plugin logparser>
<Logfile "/var/log/syslog">
FirstFullRead "false"
<Message "pcie_errors">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%- | Optional $logfile = undef | -%>
<Plugin log_parser>
<Plugin logparser>
<% $logfile.each |$file| { -%>
<% $file.keys.sort.each |$key| { -%>
<Logfile "<%= $key %>">
Expand Down
5 changes: 0 additions & 5 deletions types/log_parser/logfile.pp

This file was deleted.

5 changes: 5 additions & 0 deletions types/logparser/logfile.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#https://wiki.opnfv.org/display/fastpath/Logparser+plugin+HLD
type Collectd::LOGPARSER::Logfile = Struct[{
'firstfullread' => Boolean,
'message' => Array[Hash[String[1],Collectd::LOGPARSER::Message]]
}]
2 changes: 1 addition & 1 deletion types/log_parser/match.pp → types/logparser/match.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#https://wiki.opnfv.org/display/fastpath/Logparser+plugin+HLD
type Collectd::LOG_PARSER::Match = Struct[{
type Collectd::LOGPARSER::Match = Struct[{
'regex' => String,
Optional['submatchidx'] => Integer,
Optional['excluderegex'] => String,
Expand Down
4 changes: 2 additions & 2 deletions types/log_parser/message.pp → types/logparser/message.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#https://wiki.opnfv.org/display/fastpath/Logparser+plugin+HLD
type Collectd::LOG_PARSER::Message = Struct[{
type Collectd::LOGPARSER::Message = Struct[{
Optional['defaultplugininstance'] => String,
Optional['defaulttype'] => String,
Optional['defaulttypeinstance'] => String,
Optional['defaultseverity'] => String,
Optional['match'] => Array[Hash[String[1],Collectd::LOG_PARSER::Match]]
Optional['match'] => Array[Hash[String[1],Collectd::LOGPARSER::Match]]
}]