Skip to content

Commit 47564d3

Browse files
committed
(CAT-378) README.md / REFERENCE.md fixes
1 parent 4a72aab commit 47564d3

File tree

4 files changed

+30
-19
lines changed

4 files changed

+30
-19
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,13 @@ And run the tests from the root of the source code:
549549
bundle exec rake parallel_spec
550550
```
551551

552-
See also `.travis.yml` for information on running the acceptance and other tests.
552+
See the Github Action runs for information on running the acceptance and other tests.
553553

554554
### Migration path to v7.0.0
555555

556-
As of `v7.0.0` of this module a major rework has been done to adopt the [puppet-resource_api](https://github.com/puppetlabs/puppet-resource_api) into the module and use it style of code in place of the original form of Puppet Type and Providers. As part of this several breaking changes where made to the code that will need to be accounted for whenever you update to this new version of the module.
557-
These changes include:
556+
As of `v7.0.0` of this module a major rework has been done to adopt the [puppet-resource_api](https://github.com/puppetlabs/puppet-resource_api) into the module and use it style of code in place of the original form of Puppet Type and Providers. This was done in the most part to increase the ease with with the module could be maintained and updated in the future, the changes helping to structure the module in such a way as to be more easily understood and altered going forward.
557+
558+
As part of this process several breaking changes where made to the code that will need to be accounted for whenever you update to this new version of the module, with these changes including:
558559

559560
* The `provider` attibute within the `firewall` type has been renamed to `protocol`, both to bring it in line with the matching attribute within the `firewallchain` type and due to the resource_api forbidding the use of `provider` as a attribute name. As part of this the attribute has also been updated to accept `IPv4` and `IPv6` in place of `iptables` or `ip6tables`, though they are still valid as input.
560561
* The `action` attribute within the `firewall` type has been removed as it was merely a restricted version of the `jump` attribute, both of them managing the same function, this being reasoned as a way to enforce the use of generic parameters. From this point the parameters formerly unique to `action` should now be passed to `jump`.

REFERENCE.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,9 @@ _*this data type contains a regex that may not be accurately reflected in genera
556556

557557
ctstate => ['! INVALID', 'ESTABLISHED']
558558

559-
Note: this will negate all passed states, it is not possible to negate a single one of the array.
559+
Note:
560+
This will negate all passed states, it is not possible to negate a single one of the array.
561+
In order to maintain compatibility it is also possible to negate all values given in the array to achieve the same behaviour.
560562

561563
##### `ctstatus`
562564

@@ -582,7 +584,9 @@ _*this data type contains a regex that may not be accurately reflected in genera
582584

583585
ctstatus => ['! EXPECTED', 'CONFIRMED']
584586

585-
Note: this will negate all passed states, it is not possible to negate a single one of the array.
587+
Note:#{' '}
588+
This will negate all passed states, it is not possible to negate a single one of the array.
589+
In order to maintain compatibility it is also possible to negate all values given in the array to achieve the same behaviour.
586590

587591
##### `date_start`
588592

@@ -637,7 +641,9 @@ _*this data type contains a regex that may not be accurately reflected in genera
637641

638642
dport => ['! 54','23']
639643

640-
Note: this will negate all passed ports, it is not possible to negate a single one of the array.
644+
Note:
645+
This will negate all passed ports, it is not possible to negate a single one of the array.
646+
In order to maintain compatibility it is also possible to negate all values given in the array to achieve the same behaviour.
641647

642648
##### `dst_cc`
643649

@@ -1392,7 +1398,9 @@ _*this data type contains a regex that may not be accurately reflected in genera
13921398

13931399
sport => ['! 54','23']
13941400

1395-
Note: this will negate all passed ports, it is not possible to negate a single one of the array.
1401+
Note:
1402+
This will negate all passed ports, it is not possible to negate a single one of the array.
1403+
In order to maintain compatibility it is also possible to negate all values given in the array to achieve the same behaviour.
13961404

13971405
##### `src_cc`
13981406

@@ -1503,7 +1511,9 @@ _*this data type contains a regex that may not be accurately reflected in genera
15031511

15041512
state => ['! INVALID', 'ESTABLISHED']
15051513

1506-
Note: this will negate all passed states, it is not possible to negate a single one of the array.
1514+
Note:
1515+
This will negate all passed states, it is not possible to negate a single one of the array.
1516+
In order to maintain compatibility it is also possible to negate all values given in the array to achieve the same behaviour.
15071517

15081518
##### `string`
15091519

lib/puppet/provider/firewall/firewall.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def insync?(context, _name, property_name, is_hash, should_hash)
469469
# Retrieve the rules
470470
# Optional values lets you return a simplified set of data, used for determining order when adding/updating/deleting rules,
471471
# while also allowing for the protocols used to retrieve the rules to be limited.
472-
# @api.private
472+
# @api private
473473
def self.get_rules(context, basic, protocols = ['IPv4', 'IPv6'])
474474
# Create empty return array
475475
rules = []
@@ -498,7 +498,7 @@ def self.get_rules(context, basic, protocols = ['IPv4', 'IPv6'])
498498
end
499499

500500
# Simplified version of 'self.rules_to_hash' meant to return name, chain and table only
501-
# @api.private
501+
# @api private
502502
def self.rule_to_name(_context, rule, table_name, protocol)
503503
rule_hash = {}
504504
rule_hash[:ensure] = 'present'
@@ -517,7 +517,7 @@ def self.rule_to_name(_context, rule, table_name, protocol)
517517
end
518518

519519
# Converts a given rule to a hash value
520-
# @api.private
520+
# @api private
521521
def self.rule_to_hash(_context, rule, table_name, protocol)
522522
# loop through resource map
523523
rule_hash = {}
@@ -698,7 +698,7 @@ def self.rule_to_hash(_context, rule, table_name, protocol)
698698
end
699699

700700
# Verify that the information being retrieved is correct
701-
# @api.private
701+
# @api private
702702
def self.validate_get(_context, rules)
703703
# Verify that names are unique
704704
names = []
@@ -710,7 +710,7 @@ def self.validate_get(_context, rules)
710710
end
711711

712712
# Certain attributes need custom logic to ensure that they are returning the correct information
713-
# @api.private
713+
# @api private
714714
def self.process_get(_context, rule_hash, rule, counter)
715715
# Puppet-firewall requires that all rules have structured comments (resource names) and will fail if a
716716
# rule in iptables does not have a matching comment.
@@ -747,7 +747,7 @@ def self.create_absent(namevar, title)
747747
###### SET ######
748748

749749
# Verify that the information being set is correct
750-
# @api.private
750+
# @api private
751751
def self.validate_input(_is, should)
752752
# Verify that name does not start with 9000-9999, this range has been reserved. Ignore check when deleting the rule
753753
raise ArgumentError, 'Rule name cannot start with 9000-9999, as this range is reserved for unmanaged rules.' if should[:name].match($unmanaged_rule_regex) && should[:ensure].to_s == 'present'
@@ -861,7 +861,7 @@ def self.validate_input(_is, should)
861861
end
862862

863863
# Certain attributes need processed in ways that can vary between IPv4 and IPv6
864-
# @api.private
864+
# @api private
865865
def self.process_input(should)
866866
# `dport`, `sport` `state` `ctstate` and `ctstatus` arrays should only have the first value negated.
867867
[:dport, :sport, :state, :ctstate, :ctstatus].each do |key|
@@ -922,7 +922,7 @@ def self.process_input(should)
922922
end
923923

924924
# Converts a given hash value to a command line argument
925-
# @api.private
925+
# @api private
926926
def self.hash_to_rule(_context, _name, rule)
927927
arguments = ''
928928

@@ -1041,7 +1041,7 @@ def self.hash_to_rule(_context, _name, rule)
10411041

10421042
# Find the correct position for our new rule in its chain
10431043
# This has been lifted from the previous provider in order to maintain the logic between them
1044-
# @api.private
1044+
# @api private
10451045
def self.insert_order(context, name, chain, table, protocol)
10461046
rules = []
10471047
# Find any rules that match the given chain and table pairing

lib/puppet/provider/firewallchain/firewallchain.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def insync?(context, _name, property_name, _is_hash, _should_hash)
142142
###### PRIVATE METHODS ######
143143

144144
# Process the information so that it can be correctly applied
145-
# @api.private
145+
# @api private
146146
def self.process_input(is, should)
147147
# Split the name into it's relevant parts
148148
is[:name] = is[:title] if is[:name].nil?
@@ -162,7 +162,7 @@ def self.process_input(is, should)
162162
end
163163

164164
# Verify that the information is correct
165-
# @api.private
165+
# @api private
166166
def self.verify(_is, should)
167167
# Verify that no incorrect chain names are passed
168168
case should[:table]

0 commit comments

Comments
 (0)