From b2a7363e2b4b037b5fecf1e359d4df77769d4624 Mon Sep 17 00:00:00 2001 From: Trevor Vaughan Date: Fri, 27 Mar 2020 22:34:24 -0400 Subject: [PATCH] Native firewalld_custom_service * Create firewalld_custom_service type and provider * Add spec tests * Update Beaker tests * Mark firewalld::custom_service for deprecation * Resolve dependency loops Fixes #275 --- lib/puppet/provider/firewalld_custom_service/firewall_cmd.rb | 4 ++++ spec/unit/puppet/type/firewalld_custom_service_spec.rb | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/puppet/provider/firewalld_custom_service/firewall_cmd.rb b/lib/puppet/provider/firewalld_custom_service/firewall_cmd.rb index b6225ae3..7a8eb291 100644 --- a/lib/puppet/provider/firewalld_custom_service/firewall_cmd.rb +++ b/lib/puppet/provider/firewalld_custom_service/firewall_cmd.rb @@ -15,6 +15,8 @@ def exists? def create debug("Adding new custom service to firewalld: #{@resource[:name]}") + @property_hash[:created] = true + require 'tempfile' service_file = Tempfile.new(['puppet_firewalld_custom_service', '.xml']) @@ -33,6 +35,8 @@ def create end def destroy + @property_hash[:destroyed] = true + delete_service end diff --git a/spec/unit/puppet/type/firewalld_custom_service_spec.rb b/spec/unit/puppet/type/firewalld_custom_service_spec.rb index b23ec252..43512d52 100644 --- a/spec/unit/puppet/type/firewalld_custom_service_spec.rb +++ b/spec/unit/puppet/type/firewalld_custom_service_spec.rb @@ -18,10 +18,6 @@ resource = described_class.new(name: 'test_test') expect(resource[:name]).to eq('test_test') end - - it 'rejects invalid names' do - expect { described_class.new(name: 'bad name') }.to raise_error(%r{Valid values match}) - end end context ':description validation' do