Skip to content

Commit

Permalink
Cookstyle 5.10 fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 committed Oct 30, 2019
1 parent ab95469 commit 0ec934e
Show file tree
Hide file tree
Showing 29 changed files with 27 additions and 112 deletions.
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Author: Seth Vargo <sethvargo@gmail.com>
#
# Copyright:: 2010-2016, VMware, Inc.
# Copyright:: 2012-2017, Chef Software, Inc.
# Copyright:: 2012-2019, 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.
Expand Down
2 changes: 1 addition & 1 deletion attributes/executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author: Seth Vargo <sethvargo@gmail.com>
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, 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.
Expand Down
2 changes: 1 addition & 1 deletion attributes/master.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Author: Seth Vargo <sethvargo@gmail.com>
#
# Copyright:: 2010-2016, VMware, Inc.
# Copyright:: 2012-2017, Chef Software, Inc.
# Copyright:: 2012-2019, 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.
Expand Down
2 changes: 1 addition & 1 deletion libraries/_executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Seth Vargo <sethvargo@gmail.com>
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, 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.
Expand Down
2 changes: 1 addition & 1 deletion libraries/_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Seth Vargo <sethvargo@gmail.com>
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, 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.
Expand Down
2 changes: 1 addition & 1 deletion libraries/_params_validate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Seth Vargo <sethvargo@gmail.com>
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, 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.
Expand Down
11 changes: 1 addition & 10 deletions libraries/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Seth Vargo <sethvargo@gmail.com>
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, 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.
Expand All @@ -29,7 +29,6 @@ class Resource::JenkinsCommand < Resource::LWRPBase
identity_attr :command

# Actions
actions :execute
default_action :execute

# Attributes
Expand All @@ -41,7 +40,6 @@ class Resource::JenkinsCommand < Resource::LWRPBase

class Chef
class Provider::JenkinsCommand < Provider::LWRPBase
use_inline_resources # ~FC113
include Jenkins::Helper

provides :jenkins_command
Expand All @@ -50,13 +48,6 @@ def load_current_resource
@current_resource ||= Resource::JenkinsCommand.new(new_resource.command)
end

#
# This provider supports why-run mode.
#
def whyrun_supported?
true
end

action :execute do
converge_by("Execute #{new_resource}") do
executor.execute!(new_resource.command)
Expand Down
11 changes: 1 addition & 10 deletions libraries/credentials.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Seth Chisamore <schisamo@chef.io>
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, 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.
Expand Down Expand Up @@ -35,7 +35,6 @@ def initialize(name, run_context = nil)
end

# Actions
actions :create, :delete
default_action :create

# Attributes
Expand All @@ -59,7 +58,6 @@ def exists?

class Chef
class Provider::JenkinsCredentials < Provider::LWRPBase
use_inline_resources # ~FC113
include Jenkins::Helper

def load_current_resource
Expand All @@ -74,13 +72,6 @@ def load_current_resource
@current_resource
end

#
# This provider supports why-run mode.
#
def whyrun_supported?
true
end

#
# Create the given credentials.
#
Expand Down
1 change: 0 additions & 1 deletion libraries/credentials_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class Resource::JenkinsFileCredentials < Resource::JenkinsCredentials

class Chef
class Provider::JenkinsFileCredentials < Provider::JenkinsCredentials
use_inline_resources
include Jenkins::Helper
provides :jenkins_file_credentials

Expand Down
3 changes: 1 addition & 2 deletions libraries/credentials_password.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Seth Chisamore <schisamo@chef.io>
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, 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.
Expand Down Expand Up @@ -38,7 +38,6 @@ class Resource::JenkinsPasswordCredentials < Resource::JenkinsUserCredentials

class Chef
class Provider::JenkinsPasswordCredentials < Provider::JenkinsUserCredentials
use_inline_resources # ~FC113
provides :jenkins_password_credentials

def load_current_resource
Expand Down
3 changes: 1 addition & 2 deletions libraries/credentials_private_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Seth Chisamore <schisamo@chef.io>
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, 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.
Expand Down Expand Up @@ -71,7 +71,6 @@ def pem_private_key

class Chef
class Provider::JenkinsPrivateKeyCredentials < Provider::JenkinsUserCredentials
use_inline_resources # ~FC113
provides :jenkins_private_key_credentials

def load_current_resource
Expand Down
2 changes: 0 additions & 2 deletions libraries/credentials_secret_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class Resource::JenkinsSecretTextCredentials < Resource::JenkinsCredentials

class Chef
class Provider::JenkinsSecretTextCredentials < Provider::JenkinsCredentials
use_inline_resources # ~FC113

provides :jenkins_secret_text_credentials

def load_current_resource
Expand Down
1 change: 0 additions & 1 deletion libraries/credentials_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class Resource::JenkinsUserCredentials < Resource::JenkinsCredentials

class Chef
class Provider::JenkinsUserCredentials < Provider::JenkinsCredentials
use_inline_resources # ~FC113
include Jenkins::Helper

def load_current_resource
Expand Down
12 changes: 1 addition & 11 deletions libraries/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Seth Vargo <sethvargo@gmail.com>
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, 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.
Expand All @@ -31,7 +31,6 @@ class Resource::JenkinsJob < Resource::LWRPBase
identity_attr :name

# Actions
actions :build, :create, :delete, :disable, :enable
default_action :create

# Attributes
Expand Down Expand Up @@ -78,8 +77,6 @@ def enabled?

class Chef
class Provider::JenkinsJob < Provider::LWRPBase
use_inline_resources # ~FC113

include Jenkins::Helper

provides :jenkins_job
Expand Down Expand Up @@ -112,13 +109,6 @@ def load_current_resource
@current_resource
end

#
# This provider supports why-run mode.
#
def whyrun_supported?
true
end

#
# Executes a Jenkins job.
#
Expand Down
1 change: 0 additions & 1 deletion libraries/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class Resource::JenkinsPlugin < Resource::LWRPBase
identity_attr :name

# Actions
actions :install, :uninstall, :enable, :disable
default_action :install

# Attributes
Expand Down
10 changes: 1 addition & 9 deletions libraries/proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Stephan Linz <linz@li-pro.net>
#
# Copyright 2014, Li-Pro.Net
# Copyright:: 2014-2019, Li-Pro.Net
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,7 +32,6 @@ class Resource::JenkinsProxy < Resource::LWRPBase
identity_attr :proxy

# Actions
actions :config, :remove
default_action :config

# Attributes
Expand Down Expand Up @@ -75,13 +74,6 @@ def load_current_resource
@current_resource
end

#
# This provider supports why-run mode.
#
def whyrun_supported?
true
end

action(:config) do
if current_resource.configured? &&
current_resource.proxy == new_resource.proxy &&
Expand Down
11 changes: 1 addition & 10 deletions libraries/script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Seth Vargo <sethvargo@gmail.com>
#
# Copyright:: 2014-2017, Chef Software, Inc.
# Copyright:: 2014-2019, 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.
Expand Down Expand Up @@ -37,14 +37,12 @@ class Resource::JenkinsScript < Resource::JenkinsCommand
required: false

# Actions
actions :execute
default_action :execute
end
end

class Chef
class Provider::JenkinsScript < Provider::JenkinsCommand
use_inline_resources # ~FC113
provides :jenkins_script

def load_current_resource
Expand All @@ -58,13 +56,6 @@ def load_current_resource
super
end

#
# This provider supports why-run mode.
#
def whyrun_supported?
true
end

action :execute do
converge_by("Execute script #{new_resource}") do
if new_resource.groovy_path
Expand Down
11 changes: 1 addition & 10 deletions libraries/slave.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Seth Chisamore <schisamo@chef.io>
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, 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.
Expand All @@ -31,7 +31,6 @@ class Resource::JenkinsSlave < Resource::LWRPBase
identity_attr :slave_name

# Actions
actions :create, :delete, :connect, :disconnect, :online, :offline
default_action :create

# Attributes
Expand Down Expand Up @@ -115,7 +114,6 @@ def online?
class Chef
class Provider::JenkinsSlave < Provider::LWRPBase
provides :jenkins_slave
use_inline_resources # ~FC113

include Jenkins::Helper

Expand All @@ -139,13 +137,6 @@ def load_current_resource
@current_resource
end

#
# This provider supports why-run mode.
#
def whyrun_supported?
true
end

action :create do
do_create
end
Expand Down
4 changes: 1 addition & 3 deletions libraries/slave_jnlp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Seth Chisamore <schisamo@chef.io>
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, 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.
Expand All @@ -26,7 +26,6 @@ class Resource::JenkinsJnlpSlave < Resource::JenkinsSlave
resource_name :jenkins_jnlp_slave

# Actions
actions :create, :delete, :connect, :disconnect, :online, :offline
default_action :create

# Attributes
Expand All @@ -45,7 +44,6 @@ class Resource::JenkinsJnlpSlave < Resource::JenkinsSlave

class Chef
class Provider::JenkinsJnlpSlave < Provider::JenkinsSlave
use_inline_resources # ~FC113
provides :jenkins_jnlp_slave

def load_current_resource
Expand Down
4 changes: 1 addition & 3 deletions libraries/slave_ssh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author:: Seth Chisamore <schisamo@chef.io>
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, 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.
Expand All @@ -27,7 +27,6 @@ class Resource::JenkinsSshSlave < Resource::JenkinsSlave
resource_name :jenkins_ssh_slave

# Actions
actions :create, :delete, :connect, :disconnect, :online, :offline
default_action :create

# Attributes
Expand Down Expand Up @@ -71,7 +70,6 @@ def parsed_credentials

class Chef
class Provider::JenkinsSshSlave < Provider::JenkinsSlave
use_inline_resources # ~FC113
provides :jenkins_ssh_slave

def load_current_resource
Expand Down
Loading

0 comments on commit 0ec934e

Please sign in to comment.