From 1c6b783ee8ecdd870c04891df02044f1ffc56596 Mon Sep 17 00:00:00 2001 From: Cookstyle Bot Date: Fri, 18 Jun 2021 16:45:41 -0700 Subject: [PATCH] Cookstyle Bot Auto Corrections with Cookstyle 7.13.0 This change is automatically generated by the Cookstyle Bot using the latest version of Cookstyle (7.13.0). Adopting changes suggested by Cookstyle improves cookbook readability, avoids common coding mistakes, and eases upgrades to newer versions of the Chef Infra Client. ### Style/PercentLiteralDelimiters - **/Rakefile:27**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/libraries/_junos_api_client.rb:65**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/libraries/provider_group_junos.rb:77**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/libraries/resource_interface.rb:105**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/libraries/resource_interface.rb:120**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/libraries/resource_lag.rb:95**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/spec/unit/libraries/junos_api_client_spec.rb:55**: `%i`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/spec/unit/provider/l2_interface/junos_spec.rb:26**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/spec/unit/provider/l2_interface/junos_spec.rb:34**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/spec/unit/provider/lag/junos_spec.rb:24**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/spec/unit/provider/lag/junos_spec.rb:33**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/test/fixtures/cookbooks/group/attributes/default.rb:1**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/test/fixtures/cookbooks/group/attributes/default.rb:1**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/test/fixtures/cookbooks/group/attributes/default.rb:1**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/test/fixtures/cookbooks/l2_interface/recipes/create.rb:20**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/test/fixtures/cookbooks/lag/recipes/create.rb:28**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) - **/test/integration/lag/serverspec/lag_create_spec.rb:7**: `%w`-literals should be delimited by `(` and `)`. (https://rubystyle.guide#percent-literal-braces) ### Chef/Style/CommentFormat - **/libraries/_helper.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/_junos_api_client.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/_junos_api_transaction_handler.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/_junos_api_transport.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/platform_provider_mapping.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_group_junos.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_group_junos.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_interface_eos.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_interface_eos.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_interface_junos.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_interface_junos.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_l2_interface_eos.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_l2_interface_eos.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_l2_interface_junos.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_l2_interface_junos.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_lag_eos.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_lag_eos.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_lag_junos.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_lag_junos.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_vlan_eos.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_vlan_eos.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_vlan_junos.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/provider_vlan_junos.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_group.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_group.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_group.rb:6**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_interface.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_interface.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_interface.rb:6**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_l2_interface.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_l2_interface.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_l2_interface.rb:6**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_lag.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_lag.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_lag.rb:6**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_vlan.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_vlan.rb:5**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/libraries/resource_vlan.rb:6**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/spec/spec_helper.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/spec/support/shared_contexts/provider_junos.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/spec/unit/libraries/junos_api_client_spec.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/spec/unit/libraries/junos_api_transport_spec.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/spec/unit/provider/group/junos_spec.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/spec/unit/provider/interface/junos_spec.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/spec/unit/provider/l2_interface/junos_spec.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/spec/unit/provider/lag/junos_spec.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/spec/unit/provider/vlan/junos_spec.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/test/fixtures/cookbooks/interface/recipes/create.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/test/fixtures/cookbooks/interface/recipes/delete.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/test/fixtures/cookbooks/l2_interface/recipes/create.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/test/fixtures/cookbooks/l2_interface/recipes/delete.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/test/fixtures/cookbooks/lag/recipes/create.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/test/fixtures/cookbooks/lag/recipes/delete.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/test/fixtures/cookbooks/vlan/recipes/create.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) - **/test/fixtures/cookbooks/vlan/recipes/delete.rb:2**: Properly format header comments (https://docs.chef.io/workstation/cookstyle/chef_style_commentformat) ### Style/TrailingCommaInHashLiteral - **/libraries/_junos_api_client.rb:41**: Put a comma after the last item of a multiline hash. ### Layout/IndentationConsistency - **/libraries/_junos_api_client.rb:72**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/_junos_api_client.rb:72**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/_junos_api_client.rb:79**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/_junos_api_client.rb:150**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_group.rb:35**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_group.rb:35**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_group.rb:37**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_group.rb:37**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_group.rb:41**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_group.rb:44**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_group.rb:46**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_group.rb:49**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_interface.rb:36**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_interface.rb:36**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_interface.rb:38**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_interface.rb:38**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_interface.rb:42**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_interface.rb:45**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_interface.rb:46**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_interface.rb:47**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_interface.rb:48**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_interface.rb:49**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_interface.rb:52**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_l2_interface.rb:36**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_l2_interface.rb:36**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_l2_interface.rb:38**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_l2_interface.rb:38**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_l2_interface.rb:42**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_l2_interface.rb:45**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_l2_interface.rb:46**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_l2_interface.rb:47**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_l2_interface.rb:50**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_lag.rb:36**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_lag.rb:36**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_lag.rb:38**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_lag.rb:38**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_lag.rb:42**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_lag.rb:45**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_lag.rb:46**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_lag.rb:49**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_vlan.rb:36**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_vlan.rb:36**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_vlan.rb:38**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_vlan.rb:38**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_vlan.rb:42**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_vlan.rb:45**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_vlan.rb:46**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) - **/libraries/resource_vlan.rb:49**: Inconsistent indentation detected. (https://rubystyle.guide#spaces-indentation, https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) ### Layout/IndentationWidth - **/libraries/_junos_api_client.rb:72**: Use 2 (not -4) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/_junos_api_client.rb:72**: Use 2 (not 8) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/_junos_api_client.rb:73**: Use 2 (not 8) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/_junos_api_client.rb:149**: Use 2 (not -20) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_group.rb:35**: Use 2 (not -2) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_group.rb:35**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_group.rb:37**: Use 2 (not -2) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_group.rb:37**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_group.rb:38**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_interface.rb:36**: Use 2 (not -2) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_interface.rb:36**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_interface.rb:38**: Use 2 (not -2) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_interface.rb:38**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_interface.rb:39**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_l2_interface.rb:36**: Use 2 (not -2) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_l2_interface.rb:36**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_l2_interface.rb:38**: Use 2 (not -2) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_l2_interface.rb:38**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_l2_interface.rb:39**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_lag.rb:36**: Use 2 (not -2) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_lag.rb:36**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_lag.rb:38**: Use 2 (not -2) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_lag.rb:38**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_lag.rb:39**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_vlan.rb:36**: Use 2 (not -2) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_vlan.rb:36**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_vlan.rb:38**: Use 2 (not -2) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_vlan.rb:38**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) - **/libraries/resource_vlan.rb:39**: Use 2 (not 6) spaces for indentation. (https://rubystyle.guide#spaces-indentation) ### Lint/UnusedMethodArgument - **/libraries/_junos_api_client.rb:72**: Unused method argument - `resource_name`. If it's necessary, use `_` or `_resource_name` as an argument name to indicate that it won't be used. (https://rubystyle.guide#underscore-unused-vars) ### Chef/Modernize/ResourceNameFromInitialize - **/libraries/_junos_api_client.rb:78**: The name of a resource can be set with the "resource_name" helper instead of using the initialize method. (https://docs.chef.io/workstation/cookstyle/chef_modernize_resourcenamefrominitialize) - **/libraries/resource_group.rb:36**: The name of a resource can be set with the "resource_name" helper instead of using the initialize method. (https://docs.chef.io/workstation/cookstyle/chef_modernize_resourcenamefrominitialize) - **/libraries/resource_interface.rb:37**: The name of a resource can be set with the "resource_name" helper instead of using the initialize method. (https://docs.chef.io/workstation/cookstyle/chef_modernize_resourcenamefrominitialize) - **/libraries/resource_l2_interface.rb:37**: The name of a resource can be set with the "resource_name" helper instead of using the initialize method. (https://docs.chef.io/workstation/cookstyle/chef_modernize_resourcenamefrominitialize) - **/libraries/resource_lag.rb:37**: The name of a resource can be set with the "resource_name" helper instead of using the initialize method. (https://docs.chef.io/workstation/cookstyle/chef_modernize_resourcenamefrominitialize) - **/libraries/resource_vlan.rb:37**: The name of a resource can be set with the "resource_name" helper instead of using the initialize method. (https://docs.chef.io/workstation/cookstyle/chef_modernize_resourcenamefrominitialize) ### Layout/DefEndAlignment - **/libraries/_junos_api_client.rb:80**: `end` at 80, 6 is not aligned with `def` at 72, 0. - **/libraries/resource_group.rb:50**: `end` at 50, 4 is not aligned with `def` at 37, 0. - **/libraries/resource_interface.rb:53**: `end` at 53, 4 is not aligned with `def` at 38, 0. - **/libraries/resource_l2_interface.rb:51**: `end` at 51, 4 is not aligned with `def` at 38, 0. - **/libraries/resource_lag.rb:50**: `end` at 50, 4 is not aligned with `def` at 38, 0. - **/libraries/resource_vlan.rb:50**: `end` at 50, 4 is not aligned with `def` at 38, 0. ### Layout/RescueEnsureAlignment - **/libraries/_junos_api_client.rb:147**: `rescue` at 147, 8 is not aligned with `begin` at 145, 30. ### Style/RedundantAssignment - **/libraries/_junos_api_client.rb:220**: Redundant assignment before returning detected. ### Layout/EmptyLinesAroundMethodBody - **/libraries/_junos_api_client.rb:231**: Extra empty line detected at method body end. (https://rubystyle.guide#empty-lines-around-bodies) - **/libraries/_junos_api_client.rb:232**: Extra empty line detected at method body end. (https://rubystyle.guide#empty-lines-around-bodies) ### Layout/EmptyLines - **/libraries/_junos_api_client.rb:232**: Extra blank line detected. (https://rubystyle.guide#two-or-more-empty-lines) ### Layout/TrailingWhitespace - **/libraries/_junos_api_client.rb:232**: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace) ### Chef/Style/UsePlatformHelpers - **/libraries/_junos_api_transaction_handler.rb:34**: Use platform? and platform_family? helpers to check a node's platform (https://docs.chef.io/workstation/cookstyle/chef_style_useplatformhelpers) ### Chef/Modernize/WhyRunSupportedTrue - **/libraries/provider_group_junos.rb:34**: whyrun_supported? no longer needs to be set to true as it is the default in Chef Infra Client 13+ (https://docs.chef.io/workstation/cookstyle/chef_modernize_whyrunsupportedtrue) - **/libraries/provider_interface_eos.rb:33**: whyrun_supported? no longer needs to be set to true as it is the default in Chef Infra Client 13+ (https://docs.chef.io/workstation/cookstyle/chef_modernize_whyrunsupportedtrue) - **/libraries/provider_interface_junos.rb:34**: whyrun_supported? no longer needs to be set to true as it is the default in Chef Infra Client 13+ (https://docs.chef.io/workstation/cookstyle/chef_modernize_whyrunsupportedtrue) - **/libraries/provider_l2_interface_eos.rb:33**: whyrun_supported? no longer needs to be set to true as it is the default in Chef Infra Client 13+ (https://docs.chef.io/workstation/cookstyle/chef_modernize_whyrunsupportedtrue) - **/libraries/provider_l2_interface_junos.rb:34**: whyrun_supported? no longer needs to be set to true as it is the default in Chef Infra Client 13+ (https://docs.chef.io/workstation/cookstyle/chef_modernize_whyrunsupportedtrue) - **/libraries/provider_lag_eos.rb:33**: whyrun_supported? no longer needs to be set to true as it is the default in Chef Infra Client 13+ (https://docs.chef.io/workstation/cookstyle/chef_modernize_whyrunsupportedtrue) - **/libraries/provider_lag_junos.rb:34**: whyrun_supported? no longer needs to be set to true as it is the default in Chef Infra Client 13+ (https://docs.chef.io/workstation/cookstyle/chef_modernize_whyrunsupportedtrue) - **/libraries/provider_vlan_eos.rb:33**: whyrun_supported? no longer needs to be set to true as it is the default in Chef Infra Client 13+ (https://docs.chef.io/workstation/cookstyle/chef_modernize_whyrunsupportedtrue) - **/libraries/provider_vlan_junos.rb:34**: whyrun_supported? no longer needs to be set to true as it is the default in Chef Infra Client 13+ (https://docs.chef.io/workstation/cookstyle/chef_modernize_whyrunsupportedtrue) ### Chef/Modernize/DefaultActionFromInitialize - **/libraries/resource_group.rb:39**: The default action of a resource can be set with the "default_action" helper instead of using the initialize method. (https://docs.chef.io/workstation/cookstyle/chef_modernize_defaultactionfrominitialize) - **/libraries/resource_interface.rb:40**: The default action of a resource can be set with the "default_action" helper instead of using the initialize method. (https://docs.chef.io/workstation/cookstyle/chef_modernize_defaultactionfrominitialize) - **/libraries/resource_l2_interface.rb:40**: The default action of a resource can be set with the "default_action" helper instead of using the initialize method. (https://docs.chef.io/workstation/cookstyle/chef_modernize_defaultactionfrominitialize) - **/libraries/resource_lag.rb:40**: The default action of a resource can be set with the "default_action" helper instead of using the initialize method. (https://docs.chef.io/workstation/cookstyle/chef_modernize_defaultactionfrominitialize) - **/libraries/resource_vlan.rb:40**: The default action of a resource can be set with the "default_action" helper instead of using the initialize method. (https://docs.chef.io/workstation/cookstyle/chef_modernize_defaultactionfrominitialize) ### Layout/CommentIndentation - **/libraries/resource_group.rb:40**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_group.rb:43**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_group.rb:48**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_interface.rb:41**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_interface.rb:44**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_interface.rb:51**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_l2_interface.rb:41**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_l2_interface.rb:44**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_l2_interface.rb:49**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_lag.rb:41**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_lag.rb:44**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_lag.rb:48**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_vlan.rb:41**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_vlan.rb:44**: Incorrect indentation detected (column 10 instead of 6). - **/libraries/resource_vlan.rb:48**: Incorrect indentation detected (column 10 instead of 6). ### Layout/EmptyLineBetweenDefs - **/libraries/resource_group.rb:90**: Expected 1 empty line between class definitions; found 0. (https://rubystyle.guide#empty-lines-between-methods) ### Chef/Sharing/InvalidLicenseString - **/metadata.rb:4**: Cookbook metadata.rb does not use a SPDX compliant license string or "all rights reserved". See https://spdx.org/licenses/ for a complete list of license identifiers. (https://docs.chef.io/workstation/cookstyle/chef_sharing_invalidlicensestring) ### Chef/RedundantCode/LongDescriptionMetadata - **/metadata.rb:6**: The long_description metadata.rb method is not used and is unnecessary in cookbooks. (https://docs.chef.io/workstation/cookstyle/chef_redundantcode_longdescriptionmetadata) ### Chef/Modernize/RespondToInMetadata - **/metadata.rb:9**: It is no longer necessary to use respond_to? or defined? in metadata.rb in Chef Infra Client 12.15 and later (https://docs.chef.io/workstation/cookstyle/chef_modernize_respondtoinmetadata) - **/metadata.rb:10**: It is no longer necessary to use respond_to? or defined? in metadata.rb in Chef Infra Client 12.15 and later (https://docs.chef.io/workstation/cookstyle/chef_modernize_respondtoinmetadata) ### Style/ExpandPathArguments - **/spec/spec_helper.rb:20**: Use `expand_path('support/**/*.rb', __dir__)` instead of `expand_path('../support/**/*.rb', __FILE__)`. - **/spec/spec_helper.rb:25**: Use `expand_path('../libraries', __dir__)` instead of `expand_path('../../libraries', __FILE__)`. ### Chef/Style/AttributeKeys - **/spec/unit/provider/group/junos_spec.rb:32**: Use strings to access node attributes (https://docs.chef.io/workstation/cookstyle/chef_style_attributekeys) - **/spec/unit/provider/group/junos_spec.rb:32**: Use strings to access node attributes (https://docs.chef.io/workstation/cookstyle/chef_style_attributekeys) - **/test/fixtures/cookbooks/group/recipes/bgp_create.rb:4**: Use strings to access node attributes (https://docs.chef.io/workstation/cookstyle/chef_style_attributekeys) - **/test/fixtures/cookbooks/group/recipes/bgp_create.rb:4**: Use strings to access node attributes (https://docs.chef.io/workstation/cookstyle/chef_style_attributekeys) - **/test/fixtures/cookbooks/group/recipes/service_create.rb:4**: Use strings to access node attributes (https://docs.chef.io/workstation/cookstyle/chef_style_attributekeys) - **/test/fixtures/cookbooks/group/recipes/service_create.rb:4**: Use strings to access node attributes (https://docs.chef.io/workstation/cookstyle/chef_style_attributekeys) - **/test/fixtures/cookbooks/group/recipes/syslog_create.rb:4**: Use strings to access node attributes (https://docs.chef.io/workstation/cookstyle/chef_style_attributekeys) - **/test/fixtures/cookbooks/group/recipes/syslog_create.rb:4**: Use strings to access node attributes (https://docs.chef.io/workstation/cookstyle/chef_style_attributekeys) ### Style/StringLiterals - **/spec/unit/provider/group/junos_spec.rb:32**: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals) - **/spec/unit/provider/group/junos_spec.rb:32**: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals) - **/test/fixtures/cookbooks/group/recipes/bgp_create.rb:4**: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals) - **/test/fixtures/cookbooks/group/recipes/bgp_create.rb:4**: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals) - **/test/fixtures/cookbooks/group/recipes/service_create.rb:4**: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals) - **/test/fixtures/cookbooks/group/recipes/service_create.rb:4**: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals) - **/test/fixtures/cookbooks/group/recipes/syslog_create.rb:4**: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals) - **/test/fixtures/cookbooks/group/recipes/syslog_create.rb:4**: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals) Signed-off-by: Cookstyle --- Rakefile | 2 +- libraries/_helper.rb | 2 +- libraries/_junos_api_client.rb | 21 +++++++++---------- libraries/_junos_api_transaction_handler.rb | 4 ++-- libraries/_junos_api_transport.rb | 2 +- libraries/platform_provider_mapping.rb | 2 +- libraries/provider_group_junos.rb | 9 +++----- libraries/provider_interface_eos.rb | 7 ++----- libraries/provider_interface_junos.rb | 7 ++----- libraries/provider_l2_interface_eos.rb | 7 ++----- libraries/provider_l2_interface_junos.rb | 7 ++----- libraries/provider_lag_eos.rb | 7 ++----- libraries/provider_lag_junos.rb | 7 ++----- libraries/provider_vlan_eos.rb | 7 ++----- libraries/provider_vlan_junos.rb | 7 ++----- libraries/resource_group.rb | 14 +++++++------ libraries/resource_interface.rb | 17 ++++++++------- libraries/resource_l2_interface.rb | 13 ++++++------ libraries/resource_lag.rb | 15 ++++++------- libraries/resource_vlan.rb | 13 ++++++------ metadata.rb | 7 +++---- spec/spec_helper.rb | 6 +++--- .../support/shared_contexts/provider_junos.rb | 2 +- spec/unit/libraries/junos_api_client_spec.rb | 4 ++-- .../libraries/junos_api_transport_spec.rb | 2 +- spec/unit/provider/group/junos_spec.rb | 4 ++-- spec/unit/provider/interface/junos_spec.rb | 2 +- spec/unit/provider/l2_interface/junos_spec.rb | 6 +++--- spec/unit/provider/lag/junos_spec.rb | 6 +++--- spec/unit/provider/vlan/junos_spec.rb | 2 +- .../cookbooks/group/attributes/default.rb | 2 +- .../cookbooks/group/recipes/bgp_create.rb | 2 +- .../cookbooks/group/recipes/service_create.rb | 2 +- .../cookbooks/group/recipes/syslog_create.rb | 2 +- .../cookbooks/interface/recipes/create.rb | 2 +- .../cookbooks/interface/recipes/delete.rb | 2 +- .../cookbooks/l2_interface/recipes/create.rb | 4 ++-- .../cookbooks/l2_interface/recipes/delete.rb | 2 +- test/fixtures/cookbooks/lag/recipes/create.rb | 4 ++-- test/fixtures/cookbooks/lag/recipes/delete.rb | 2 +- .../fixtures/cookbooks/vlan/recipes/create.rb | 2 +- .../fixtures/cookbooks/vlan/recipes/delete.rb | 2 +- .../lag/serverspec/lag_create_spec.rb | 2 +- 43 files changed, 109 insertions(+), 132 deletions(-) diff --git a/Rakefile b/Rakefile index fad9b80..75a18f7 100644 --- a/Rakefile +++ b/Rakefile @@ -24,7 +24,7 @@ end # We cannot run Test Kitchen on Travis CI yet... namespace :travis do desc 'Run tests on Travis' - task ci: %w[style unit] + task ci: %w(style unit) end # The default rake task should just run it all diff --git a/libraries/_helper.rb b/libraries/_helper.rb index e3e3f3c..75aa9ca 100644 --- a/libraries/_helper.rb +++ b/libraries/_helper.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/libraries/_junos_api_client.rb b/libraries/_junos_api_client.rb index 9f0097a..257ecfa 100644 --- a/libraries/_junos_api_client.rb +++ b/libraries/_junos_api_client.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ class ApiClient ip_ports: ::Junos::Ez::IPports, vlans: ::Junos::Ez::Vlans, lag_ports: ::Junos::Ez::LAGports, - group: ::Junos::Ez::Group + group: ::Junos::Ez::Group, }.freeze KNOWN_RESOURCES.each_pair do |resource, provider_module| @@ -62,12 +62,14 @@ def initialize(resource_name) # The `Junos::Ez` providers expect certain values # to be symbolized or requests will fail. - VALUES_TO_SYMBOLIZE = %w[auto up down half full active passive disabled].freeze + VALUES_TO_SYMBOLIZE = %w(auto up down half full active passive disabled).freeze attr_reader :resource_type attr_reader :resource_name - def initialize(resource_type, resource_name) + resource_name resource_name + + def initialize(resource_type, _resource_name) unless KNOWN_RESOURCES.keys.include?(resource_type) error_message = "Invalid resource type :#{resource_type}." error_message << " Try one of: :#{KNOWN_RESOURCES.keys.join(', :')}" @@ -75,7 +77,6 @@ def initialize(resource_type, resource_name) end @resource_type = resource_type - @resource_name = resource_name end # Writes managed resource to the candidate configuration. @@ -144,9 +145,9 @@ def updated_changed_properties(new_values, current_values) def managed_resource @managed_resource ||= begin transport.send(resource_type)[resource_name] - rescue Netconf::RpcError => e - Chef::Log.debug("Managed Resource #{resource_name} not found: #{e}") - nil + rescue Netconf::RpcError => e + Chef::Log.debug("Managed Resource #{resource_name} not found: #{e}") + nil end end @@ -217,7 +218,7 @@ def format_rpc_error(rpc_error) # fall back to ugly xml end - error_msg = <<-MSG + <<-MSG JUNOS XML REQUEST: @@ -227,8 +228,6 @@ def format_rpc_error(rpc_error) #{response.to_xml} MSG - - error_msg end end end diff --git a/libraries/_junos_api_transaction_handler.rb b/libraries/_junos_api_transaction_handler.rb index 9939689..8af883d 100644 --- a/libraries/_junos_api_transaction_handler.rb +++ b/libraries/_junos_api_transaction_handler.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ class JunosCommitTransactionHandler < Chef::Handler def report # Ensure handler is no-op in why-run mode and non-Junos platforms. - if (node['platform'] == 'junos' || (node['platform_version'].include? 'JNPR')) && !Chef::Config[:why_run] + if (platform?('junos') || (node['platform_version'].include? 'JNPR')) && !Chef::Config[:why_run] begin # on successful Chef-runs commit the transaction if success? diff --git a/libraries/_junos_api_transport.rb b/libraries/_junos_api_transport.rb index 5122bf7..3edcac2 100644 --- a/libraries/_junos_api_transport.rb +++ b/libraries/_junos_api_transport.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/libraries/platform_provider_mapping.rb b/libraries/platform_provider_mapping.rb index c385d9c..bd42ec8 100644 --- a/libraries/platform_provider_mapping.rb +++ b/libraries/platform_provider_mapping.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/libraries/provider_group_junos.rb b/libraries/provider_group_junos.rb index d074b0b..83d21fa 100644 --- a/libraries/provider_group_junos.rb +++ b/libraries/provider_group_junos.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Provider:: group # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,9 +31,6 @@ class Provider::NetdevGroup::Junos < Provider # # This provider supports why-run mode. # - def whyrun_supported? - true - end def load_current_resource @current_resource = Chef::Resource::NetdevGroup.new(new_resource.name) @@ -74,7 +71,7 @@ def action_create @new_values[:path] = @file_path format = @new_values[:template_path].split('/')[-1].split('.') if format[1] != 'erb' - unless %w[xml text set].include? format[1] + unless %w(xml text set).include? format[1] failure_msg = "Invalid format #{format[1]} in #{@new_values[:template_path]}. Valid format values: 'xml', 'text', 'set'.\n\n" Chef::Log.fatal(failure_msg) raise(failure_msg) diff --git a/libraries/provider_interface_eos.rb b/libraries/provider_interface_eos.rb index c277d9c..cc73474 100644 --- a/libraries/provider_interface_eos.rb +++ b/libraries/provider_interface_eos.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Provider:: interface # -# Copyright 2013, Arista Networks +# Copyright:: 2013, Arista Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,9 +30,6 @@ class Provider::NetdevInterface::EOS < Provider # # This provider supports why-run mode. # - def whyrun_supported? - true - end def load_current_resource @current_resource = Chef::Resource::NetdevInterface.new(@new_resource.name) diff --git a/libraries/provider_interface_junos.rb b/libraries/provider_interface_junos.rb index 6a580cb..9e7610a 100644 --- a/libraries/provider_interface_junos.rb +++ b/libraries/provider_interface_junos.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Provider:: interface # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,9 +31,6 @@ class Provider::NetdevInterface::Junos < Provider # # This provider supports why-run mode. # - def whyrun_supported? - true - end def load_current_resource @current_resource = Chef::Resource::NetdevInterface.new(new_resource.name) diff --git a/libraries/provider_l2_interface_eos.rb b/libraries/provider_l2_interface_eos.rb index ba72bd5..37d27d2 100644 --- a/libraries/provider_l2_interface_eos.rb +++ b/libraries/provider_l2_interface_eos.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Provider:: l2_interface # -# Copyright 2013, Arista Networks +# Copyright:: 2013, Arista Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,9 +30,6 @@ class Provider::NetdevL2Interface::EOS < Provider # # This provider supports why-run mode. # - def whyrun_supported? - true - end def load_current_resource @current_resource = Chef::Resource::NetdevL2Interface.new(new_resource.name) diff --git a/libraries/provider_l2_interface_junos.rb b/libraries/provider_l2_interface_junos.rb index ad07b69..4422509 100644 --- a/libraries/provider_l2_interface_junos.rb +++ b/libraries/provider_l2_interface_junos.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Provider:: l2_interface # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,9 +31,6 @@ class Provider::NetdevL2Interface::Junos < Provider # # This provider supports why-run mode. # - def whyrun_supported? - true - end def load_current_resource @current_resource = Chef::Resource::NetdevL2Interface.new(new_resource.name) diff --git a/libraries/provider_lag_eos.rb b/libraries/provider_lag_eos.rb index 997e864..bf5b4e2 100644 --- a/libraries/provider_lag_eos.rb +++ b/libraries/provider_lag_eos.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Provider:: lag # -# Copyright 2013, Arista Networks +# Copyright:: 2013, Arista Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,9 +30,6 @@ class Provider::NetdevLinkAggregationGroup::EOS < Provider # # This provider supports why-run mode. # - def whyrun_supported? - true - end def load_current_resource @current_resource = Chef::Resource::NetdevLinkAggregationGroup.new(new_resource.name) diff --git a/libraries/provider_lag_junos.rb b/libraries/provider_lag_junos.rb index 1a8982a..32b22d4 100644 --- a/libraries/provider_lag_junos.rb +++ b/libraries/provider_lag_junos.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Provider:: lag # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,9 +31,6 @@ class Provider::NetdevLinkAggregationGroup::Junos < Provider # # This provider supports why-run mode. # - def whyrun_supported? - true - end def load_current_resource @current_resource = Chef::Resource::NetdevLinkAggregationGroup.new(new_resource.name) diff --git a/libraries/provider_vlan_eos.rb b/libraries/provider_vlan_eos.rb index ef52fe7..17f6aa9 100644 --- a/libraries/provider_vlan_eos.rb +++ b/libraries/provider_vlan_eos.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Provider:: vlan # -# Copyright 2013, Arista Networks +# Copyright:: 2013, Arista Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,9 +30,6 @@ class Provider::NetdevVirtualLAN::EOS < Provider # # This provider supports why-run mode. # - def whyrun_supported? - true - end def load_current_resource @current_resource = Chef::Resource::NetdevVirtualLAN.new(new_resource.name) diff --git a/libraries/provider_vlan_junos.rb b/libraries/provider_vlan_junos.rb index 1b81d01..60824e8 100644 --- a/libraries/provider_vlan_junos.rb +++ b/libraries/provider_vlan_junos.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Provider:: vlan # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,9 +31,6 @@ class Provider::NetdevVirtualLAN::Junos < Provider # # This provider supports why-run mode. # - def whyrun_supported? - true - end def load_current_resource @current_resource = Chef::Resource::NetdevVirtualLAN.new(new_resource.name) diff --git a/libraries/resource_group.rb b/libraries/resource_group.rb index b75d3a7..4dbdd0d 100644 --- a/libraries/resource_group.rb +++ b/libraries/resource_group.rb @@ -1,9 +1,9 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Resource:: JUNOS apply group # -# Copyright 2014, Chef Software, Inc. -# Copyright 2015, Juniper Network. +# Copyright:: 2014, Chef Software, Inc. +# Copyright:: 2015, Juniper Network. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,13 +30,14 @@ class Resource::NetdevGroup < Resource attr_accessor :exists alias exists? exists + resource_name :netdev_group + + default_action :create + def initialize(name, run_context = nil) super - @resource_name = :netdev_group - # Set default actions and allowed actions - @action = :create @allowed_actions.push(:create, :delete) # Set the name attribute and default attributes @@ -87,4 +88,5 @@ def template_path(arg = nil) end end end + class Chef::Provider::NetdevGroup; end diff --git a/libraries/resource_interface.rb b/libraries/resource_interface.rb index 8ef2f2e..ee5c2db 100644 --- a/libraries/resource_interface.rb +++ b/libraries/resource_interface.rb @@ -1,9 +1,9 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Resource:: interface # -# Copyright 2013, Arista Networks -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2013, Arista Networks +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,13 +31,14 @@ class Resource::NetdevInterface < Resource alias active? active alias exists? exists + resource_name :netdev_interface + + default_action :create + def initialize(name, run_context = nil) super - @resource_name = :netdev_interface - # Set default actions and allowed actions - @action = :create @allowed_actions.push(:create, :delete) # Set the name attribute and default attributes @@ -102,7 +103,7 @@ def speed(arg = nil) :speed, arg, kind_of: String, - equal_to: %w[auto 10m 100m 1g 10g 40g 56g 100g] + equal_to: %w(auto 10m 100m 1g 10g 40g 56g 100g) ) end @@ -117,7 +118,7 @@ def duplex(arg = nil) :duplex, arg, kind_of: String, - equal_to: %w[auto half full] + equal_to: %w(auto half full) ) end end diff --git a/libraries/resource_l2_interface.rb b/libraries/resource_l2_interface.rb index e922faa..ea897ff 100644 --- a/libraries/resource_l2_interface.rb +++ b/libraries/resource_l2_interface.rb @@ -1,9 +1,9 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Resource:: interface # -# Copyright 2013, Arista Networks -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2013, Arista Networks +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,13 +31,14 @@ class Resource::NetdevL2Interface < Resource alias active? active alias exists? exists + resource_name :netdev_l2_interface + + default_action :create + def initialize(name, run_context = nil) super - @resource_name = :netdev_l2_interface - # Set default actions and allowed actions - @action = :create @allowed_actions.push(:create, :delete) # Set the name attribute and default attributes diff --git a/libraries/resource_lag.rb b/libraries/resource_lag.rb index 3827bb6..e72d4cc 100644 --- a/libraries/resource_lag.rb +++ b/libraries/resource_lag.rb @@ -1,9 +1,9 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Resource:: lag # -# Copyright 2013, Arista Networks -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2013, Arista Networks +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,13 +31,14 @@ class Resource::NetdevLinkAggregationGroup < Resource alias active? active alias exists? exists + resource_name :netdev_lag + + default_action :create + def initialize(name, run_context = nil) super - @resource_name = :netdev_lag - # Set default actions and allowed actions - @action = :create @allowed_actions.push(:create, :delete) # Set the name attribute and default attributes @@ -92,7 +93,7 @@ def lacp(arg = nil) :lacp, arg, kind_of: String, - equal_to: %w[disable active passive] + equal_to: %w(disable active passive) ) end end diff --git a/libraries/resource_vlan.rb b/libraries/resource_vlan.rb index efac38f..cf0ac30 100644 --- a/libraries/resource_vlan.rb +++ b/libraries/resource_vlan.rb @@ -1,9 +1,9 @@ # -# Cookbook Name:: netdev +# Cookbook:: netdev # Resource:: vlan # -# Copyright 2013, Arista Networks -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2013, Arista Networks +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,13 +31,14 @@ class Resource::NetdevVirtualLAN < Resource alias active? active alias exists? exists + resource_name :netdev_vlan + + default_action :create + def initialize(name, run_context = nil) super - @resource_name = :netdev_vlan - # Set default actions and allowed actions - @action = :create @allowed_actions.push(:create, :delete) # Set the name attribute and default attributes diff --git a/metadata.rb b/metadata.rb index 9151a50..30f232a 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,10 +1,9 @@ name 'netdev' maintainer 'Chef Software, Inc.' maintainer_email 'releng@chef.io' -license 'Apache 2.0' +license 'Apache-2.0' description 'Provides a set of vendor-neutral resources for managing networking devices' -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '2.1.0' -source_url 'https://github.com/chef-partners/netdev' if respond_to?(:source_url) -issues_url 'https://github.com/chef-partners/netdev/issues' if respond_to?(:issues_url) +source_url 'https://github.com/chef-partners/netdev' +issues_url 'https://github.com/chef-partners/netdev/issues' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index cd3b7ec..5210642 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,12 +17,12 @@ require 'chefspec' # load all shared examples and shared contexts -Dir[File.expand_path('../support/**/*.rb', __FILE__)].each do |file| +Dir[File.expand_path('support/**/*.rb', __dir__)].each do |file| require(file) end # load all library files for easy mocking -libs = File.expand_path('../../libraries', __FILE__) +libs = File.expand_path('../libraries', __dir__) $LOAD_PATH.unshift(libs) unless $LOAD_PATH.include?(libs) Dir[File.join(libs, '*.rb')].each do |lib| require File.basename(lib, '.rb') diff --git a/spec/support/shared_contexts/provider_junos.rb b/spec/support/shared_contexts/provider_junos.rb index 234c0f3..59ff6fb 100644 --- a/spec/support/shared_contexts/provider_junos.rb +++ b/spec/support/shared_contexts/provider_junos.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/spec/unit/libraries/junos_api_client_spec.rb b/spec/unit/libraries/junos_api_client_spec.rb index cc5b1cb..b217545 100644 --- a/spec/unit/libraries/junos_api_client_spec.rb +++ b/spec/unit/libraries/junos_api_client_spec.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ instance end - %i[write! delete! activate! deactivate!].each do |action| + %i(write! delete! activate! deactivate!).each do |action| it "performs a config check after action: #{action}" do expect(transport).to receive(:commit?).once subject.send(action) diff --git a/spec/unit/libraries/junos_api_transport_spec.rb b/spec/unit/libraries/junos_api_transport_spec.rb index 2cd0a2f..ee58ce4 100644 --- a/spec/unit/libraries/junos_api_transport_spec.rb +++ b/spec/unit/libraries/junos_api_transport_spec.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/spec/unit/provider/group/junos_spec.rb b/spec/unit/provider/group/junos_spec.rb index 4e58ab5..eca211b 100644 --- a/spec/unit/provider/group/junos_spec.rb +++ b/spec/unit/provider/group/junos_spec.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ let(:new_resource) do new_resource = Chef::Resource::NetdevGroup.new('service_group') new_resource.template_path('services.set.erb') - new_resource.variables(services: node[:netdev][:services]) + new_resource.variables(services: node['netdev']['services']) new_resource end diff --git a/spec/unit/provider/interface/junos_spec.rb b/spec/unit/provider/interface/junos_spec.rb index e7e1ca1..0561a7b 100644 --- a/spec/unit/provider/interface/junos_spec.rb +++ b/spec/unit/provider/interface/junos_spec.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/spec/unit/provider/l2_interface/junos_spec.rb b/spec/unit/provider/l2_interface/junos_spec.rb index adc5ff4..ac8a883 100644 --- a/spec/unit/provider/l2_interface/junos_spec.rb +++ b/spec/unit/provider/l2_interface/junos_spec.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ port = double('port', exists?: true) allow(port).to receive(:[]).with(:description) { 'blahblahblah' } allow(port).to receive(:[]).with(:untagged_vlan) { 'default' } - allow(port).to receive(:[]).with(:tagged_vlans) { %w[chef-test] } + allow(port).to receive(:[]).with(:tagged_vlans) { %w(chef-test) } allow(port).to receive(:[]).with(:vlan_tagging) { true } allow(port).to receive(:[]).with(:_active) { true } port @@ -31,7 +31,7 @@ let(:new_resource) do new_resource = Chef::Resource::NetdevL2Interface.new('ge-0/0/0') - new_resource.tagged_vlans(%w[chef-test]) + new_resource.tagged_vlans(%w(chef-test)) new_resource.vlan_tagging(true) new_resource end diff --git a/spec/unit/provider/lag/junos_spec.rb b/spec/unit/provider/lag/junos_spec.rb index 343800c..9ffc511 100644 --- a/spec/unit/provider/lag/junos_spec.rb +++ b/spec/unit/provider/lag/junos_spec.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ let(:managed_resource) do lag = double('lag', exists?: true) - allow(lag).to receive(:[]).with(:links) { %w[ge-0/0/1 ge-0/0/2] } + allow(lag).to receive(:[]).with(:links) { %w(ge-0/0/1 ge-0/0/2) } allow(lag).to receive(:[]).with(:minimum_links) { 2 } allow(lag).to receive(:[]).with(:lacp) { 'disabled' } allow(lag).to receive(:[]).with(:_active) { true } @@ -30,7 +30,7 @@ let(:new_resource) do new_resource = Chef::Resource::NetdevLinkAggregationGroup.new('ae0') - new_resource.links(%w[ge-0/0/1 ge-0/0/2]) + new_resource.links(%w(ge-0/0/1 ge-0/0/2)) new_resource.minimum_links(1) new_resource.lacp('disable') new_resource diff --git a/spec/unit/provider/vlan/junos_spec.rb b/spec/unit/provider/vlan/junos_spec.rb index a3a5b5e..727fe73 100644 --- a/spec/unit/provider/vlan/junos_spec.rb +++ b/spec/unit/provider/vlan/junos_spec.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/fixtures/cookbooks/group/attributes/default.rb b/test/fixtures/cookbooks/group/attributes/default.rb index cc00698..b6911e2 100644 --- a/test/fixtures/cookbooks/group/attributes/default.rb +++ b/test/fixtures/cookbooks/group/attributes/default.rb @@ -1,4 +1,4 @@ -default[:netdev][:services] = [%w[ftp], %w[ssh], %w[netconf ssh]] +default[:netdev][:services] = [%w(ftp), %w(ssh), %w(netconf ssh)] default[:netdev][:bgp] = { 'internal' => { 'type' => 'internal', 'neighbor' => ['10.10.10.10', '10.10.10.11'], 'local-address' => '20.20.20.20', 'peer-as' => '100' }, 'external' => { 'type' => 'external', 'neighbor' => ['30.30.10.10', '30.30.10.11'], 'local-address' => '20.20.20.20', 'peer-as' => '200' } } diff --git a/test/fixtures/cookbooks/group/recipes/bgp_create.rb b/test/fixtures/cookbooks/group/recipes/bgp_create.rb index addeb0e..f93c68b 100644 --- a/test/fixtures/cookbooks/group/recipes/bgp_create.rb +++ b/test/fixtures/cookbooks/group/recipes/bgp_create.rb @@ -1,5 +1,5 @@ netdev_group 'bgp_group' do template_path 'bgp.xml.erb' action :create - variables(bgp: node[:netdev][:bgp]) + variables(bgp: node['netdev']['bgp']) end diff --git a/test/fixtures/cookbooks/group/recipes/service_create.rb b/test/fixtures/cookbooks/group/recipes/service_create.rb index 8d3b092..70b3992 100644 --- a/test/fixtures/cookbooks/group/recipes/service_create.rb +++ b/test/fixtures/cookbooks/group/recipes/service_create.rb @@ -1,5 +1,5 @@ netdev_group 'service_group' do template_path 'services.set.erb' action :create - variables(services: node[:netdev][:services]) + variables(services: node['netdev']['services']) end diff --git a/test/fixtures/cookbooks/group/recipes/syslog_create.rb b/test/fixtures/cookbooks/group/recipes/syslog_create.rb index 95679f4..ae92960 100644 --- a/test/fixtures/cookbooks/group/recipes/syslog_create.rb +++ b/test/fixtures/cookbooks/group/recipes/syslog_create.rb @@ -1,5 +1,5 @@ netdev_group 'syslog_group' do template_path 'syslog.text.erb' action :create - variables(syslog_names: node[:netdev][:syslog]) + variables(syslog_names: node['netdev']['syslog']) end diff --git a/test/fixtures/cookbooks/interface/recipes/create.rb b/test/fixtures/cookbooks/interface/recipes/create.rb index a48f03e..9aa2f5c 100644 --- a/test/fixtures/cookbooks/interface/recipes/create.rb +++ b/test/fixtures/cookbooks/interface/recipes/create.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/fixtures/cookbooks/interface/recipes/delete.rb b/test/fixtures/cookbooks/interface/recipes/delete.rb index c6b3134..a8c722a 100644 --- a/test/fixtures/cookbooks/interface/recipes/delete.rb +++ b/test/fixtures/cookbooks/interface/recipes/delete.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/fixtures/cookbooks/l2_interface/recipes/create.rb b/test/fixtures/cookbooks/l2_interface/recipes/create.rb index 59228d0..7a0432c 100644 --- a/test/fixtures/cookbooks/l2_interface/recipes/create.rb +++ b/test/fixtures/cookbooks/l2_interface/recipes/create.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ include_recipe 'vlan::create' netdev_l2_interface 'ge-0/0/0' do - tagged_vlans %w[chef-test] + tagged_vlans %w(chef-test) vlan_tagging true action :create end diff --git a/test/fixtures/cookbooks/l2_interface/recipes/delete.rb b/test/fixtures/cookbooks/l2_interface/recipes/delete.rb index 5993c13..246e322 100644 --- a/test/fixtures/cookbooks/l2_interface/recipes/delete.rb +++ b/test/fixtures/cookbooks/l2_interface/recipes/delete.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/fixtures/cookbooks/lag/recipes/create.rb b/test/fixtures/cookbooks/lag/recipes/create.rb index ab7dec4..39bced9 100644 --- a/test/fixtures/cookbooks/lag/recipes/create.rb +++ b/test/fixtures/cookbooks/lag/recipes/create.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ end netdev_lag 'ae0' do - links %w[ge-0/0/1 ge-0/0/2] + links %w(ge-0/0/1 ge-0/0/2) minimum_links 1 lacp 'disable' action :create diff --git a/test/fixtures/cookbooks/lag/recipes/delete.rb b/test/fixtures/cookbooks/lag/recipes/delete.rb index b559c31..2532ebe 100644 --- a/test/fixtures/cookbooks/lag/recipes/delete.rb +++ b/test/fixtures/cookbooks/lag/recipes/delete.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/fixtures/cookbooks/vlan/recipes/create.rb b/test/fixtures/cookbooks/vlan/recipes/create.rb index 46974e4..a43e02c 100644 --- a/test/fixtures/cookbooks/vlan/recipes/create.rb +++ b/test/fixtures/cookbooks/vlan/recipes/create.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/fixtures/cookbooks/vlan/recipes/delete.rb b/test/fixtures/cookbooks/vlan/recipes/delete.rb index 2788dc6..73281f6 100644 --- a/test/fixtures/cookbooks/vlan/recipes/delete.rb +++ b/test/fixtures/cookbooks/vlan/recipes/delete.rb @@ -1,5 +1,5 @@ # -# Copyright 2014, Chef Software, Inc. +# Copyright:: 2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/integration/lag/serverspec/lag_create_spec.rb b/test/integration/lag/serverspec/lag_create_spec.rb index 03fc67f..ca32cdf 100644 --- a/test/integration/lag/serverspec/lag_create_spec.rb +++ b/test/integration/lag/serverspec/lag_create_spec.rb @@ -4,7 +4,7 @@ include Serverspec::Helper::Exec include Serverspec::Helper::DetectOS -%w[ge-0/0/1 ge-0/0/2].each do |l2_interface| +%w(ge-0/0/1 ge-0/0/2).each do |l2_interface| describe command("cli show config interfaces #{l2_interface}") do it { should return_stdout(/802.3ad ae0;/) } end