Skip to content

Commit

Permalink
rename log_parser to logparser
Browse files Browse the repository at this point in the history
  • Loading branch information
prabiegx committed Apr 1, 2020
1 parent b2f7e70 commit b6f6b8c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
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]]
}]

0 comments on commit b6f6b8c

Please sign in to comment.