Skip to content

Commit

Permalink
Merge branch 'master' into sysconfig-variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rnt committed Nov 20, 2019
2 parents a2895bc + 61bd043 commit c5d7cf3
Show file tree
Hide file tree
Showing 33 changed files with 41 additions and 129 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ addons:
packages:
- chef-workstation

# Don't `bundle install` which takes about 1.5 mins
install: echo "skip bundle install"

env:
Expand Down Expand Up @@ -36,8 +35,6 @@ before_script:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- eval "$(chef shell-init bash)"
- chef --version
- cookstyle --version
- foodcritic --version

script: KITCHEN_LOCAL_YAML=kitchen.dokken.yml kitchen verify ${INSTANCE}

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This gemfile provides additional gems for testing and releasing this cookbook
# It is meant to be installed on top of ChefDK which provides the majority
# It is meant to be installed on top of ChefDK / Chef Workstation which provide the majority
# of the necessary gems for testing this cookbook
#
# Run 'chef exec bundle install' to install these dependencies
Expand Down
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 kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ platforms:
box: gbailey/amzn2
- name: centos-6
- name: centos-7
- name: debian-8
- name: debian-9
- name: debian-10
- name: ubuntu-16.04
- name: ubuntu-18.04
- name: windows-2012r2
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
8 changes: 4 additions & 4 deletions 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 Expand Up @@ -33,18 +33,18 @@ def set_or_return(symbol, arg, validation)
if arg.nil? && instance_variable_defined?(iv_symbol) == true
ivar = instance_variable_get(iv_symbol)
if ivar.is_a?(DelayedEvaluator)
validate({ symbol => ivar.call }, { symbol => validation })[symbol] # rubocop:disable BracesAroundHashParameters
validate({ symbol => ivar.call }, { symbol => validation })[symbol] # rubocop:disable Style/BracesAroundHashParameters
else
ivar
end
else
if arg.is_a?(DelayedEvaluator)
val = arg
else
val = validate({ symbol => arg }, { symbol => validation })[symbol] # rubocop:disable BracesAroundHashParameters
val = validate({ symbol => arg }, { symbol => validation })[symbol] # rubocop:disable Style/BracesAroundHashParameters

# Handle the case where the "default" was a DelayedEvaluator
val = val.call(self) if val.is_a?(DelayedEvaluator) # rubocop:disable BlockNesting
val = val.call(self) if val.is_a?(DelayedEvaluator) # rubocop:disable Metrics/BlockNesting
end
instance_variable_set(iv_symbol, val)
end
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
Loading

0 comments on commit c5d7cf3

Please sign in to comment.