Skip to content

Commit 959fb12

Browse files
authored
Merge pull request #469 from puppetlabs/CAT-1728-deferred-function-undefined
(CAT-1728) - Unable to use password function as deferred function
2 parents 931b98c + ed97d7c commit 959fb12

File tree

10 files changed

+20
-49
lines changed

10 files changed

+20
-49
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "Publish module"
22

33
on:
44
workflow_dispatch:
5-
5+
66
jobs:
77
release:
88
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main"

.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,8 @@ Lint/DuplicateBranch:
529529
Enabled: false
530530
Lint/DuplicateMagicComment:
531531
Enabled: false
532+
Lint/DuplicateMatchPattern:
533+
Enabled: false
532534
Lint/DuplicateRegexpCharacterClassElement:
533535
Enabled: false
534536
Lint/EmptyBlock:
@@ -645,6 +647,8 @@ Style/ComparableClamp:
645647
Enabled: false
646648
Style/ConcatArrayLiterals:
647649
Enabled: false
650+
Style/DataInheritance:
651+
Enabled: false
648652
Style/DirEmpty:
649653
Enabled: false
650654
Style/DocumentDynamicEvalDefinition:
@@ -713,6 +717,8 @@ Style/RedundantHeredocDelimiterQuotes:
713717
Enabled: false
714718
Style/RedundantInitialize:
715719
Enabled: false
720+
Style/RedundantLineContinuation:
721+
Enabled: false
716722
Style/RedundantSelfAssignmentBranch:
717723
Enabled: false
718724
Style/RedundantStringEscape:

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"recommendations": [
33
"puppet.puppet-vscode",
4-
"rebornix.Ruby"
4+
"Shopify.ruby-lsp"
55
]
66
}

Gemfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,15 @@ group :development do
2222
gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2323
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
2424
gem "facterdb", '~> 1.18', require: false
25-
gem "metadata-json-lint", '~> 3.0', require: false
25+
gem "metadata-json-lint", '~> 4.0', require: false
2626
gem "puppetlabs_spec_helper", '~> 6.0', require: false
2727
gem "rspec-puppet-facts", '~> 2.0', require: false
28-
gem "codecov", '~> 0.2', require: false
2928
gem "dependency_checker", '~> 1.0.0', require: false
3029
gem "parallel_tests", '= 3.12.1', require: false
3130
gem "pry", '~> 0.10', require: false
32-
gem "simplecov-console", '~> 0.5', require: false
31+
gem "simplecov-console", '~> 0.9', require: false
3332
gem "puppet-debugger", '~> 1.0', require: false
34-
gem "rubocop", '= 1.48.1', require: false
33+
gem "rubocop", '~> 1.50.0', require: false
3534
gem "rubocop-performance", '= 1.16.0', require: false
3635
gem "rubocop-rspec", '= 2.19.0', require: false
3736
gem "puppet-strings", '~> 4.0', require: false

REFERENCE.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
### Functions
2626

2727
* [`sqlserver::partial_params_args`](#sqlserver--partial_params_args): this function populates and returns the string of arguments which later gets injected in template.
28-
* [`sqlserver::password`](#sqlserver--password): This function exists for usage of a role password that is a deferred function
2928
* [`sqlserver_is_domain_or_local_user`](#sqlserver_is_domain_or_local_user)
3029
* [`sqlserver_upcase`](#sqlserver_upcase)
3130
* [`sqlserver_validate_hash_uniq_values`](#sqlserver_validate_hash_uniq_values)
@@ -1236,24 +1235,6 @@ Optional[Enum['ON', 'OFF']] $nested_triggers
12361235
Optional[Enum['ON', 'OFF']] $transform_noise_words
12371236
Integer[1753, 9999] $two_digit_year_cutoff
12381237

1239-
### <a name="sqlserver--password"></a>`sqlserver::password`
1240-
1241-
Type: Ruby 4.x API
1242-
1243-
This function exists for usage of a role password that is a deferred function
1244-
1245-
#### `sqlserver::password(Optional[Any] $pass)`
1246-
1247-
This function exists for usage of a role password that is a deferred function
1248-
1249-
Returns: `Any`
1250-
1251-
##### `pass`
1252-
1253-
Data type: `Optional[Any]`
1254-
1255-
1256-
12571238
### <a name="sqlserver_is_domain_or_local_user"></a>`sqlserver_is_domain_or_local_user`
12581239

12591240
Type: Ruby 3.x API

lib/puppet/functions/sqlserver/password.rb

Lines changed: 0 additions & 13 deletions
This file was deleted.

manifests/login.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@
8080
$create_delete_login_parameters = {
8181
'disabled' => $disabled,
8282
'login' => $login,
83-
'password' => Deferred('sqlserver::password', [$password]),
83+
'password' => $password ? {
84+
undef => undef,
85+
default => Deferred('sprintf', [$password]),
86+
},
8487
'check_expiration' => $check_expiration,
8588
'check_policy' => $check_policy,
8689
'default_language' => $default_language,

manifests/user.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@
6565
if $create_delete == 'create' {
6666
$create_delete_user_parameters = {
6767
'database' => $database,
68-
'password' => Deferred('sqlserver::password', [$password]),
68+
'password' => $password ? {
69+
undef => undef,
70+
default => Deferred('sprintf', [$password]),
71+
},
6972
'user' => $user,
7073
'login' => $login,
7174
'default_schema' => $default_schema,

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@
5050
],
5151
"pdk-version": "3.0.0",
5252
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
53-
"template-ref": "heads/main-0-g79a2f93"
53+
"template-ref": "heads/main-0-g0f7378b"
5454
}

spec/functions/password_spec.rb

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)