Skip to content

(CONT-904) - Removal of tech debt #1429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions manifests/server/grant.pp
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@
default: {
$_granted_object = $_object_name
$_togrant_object = $_object_name
# if $_togrant_object_only not set, set it to a default value $_togrant_object
# allows an Array or String to be passed as $_object_name i.e. [$schema, $table] or $table
$_togrant_object_only = $_togrant_object
}
}

Expand All @@ -449,9 +452,9 @@

$_onlyif = $onlyif_function ? {
'table_exists' => "SELECT true FROM pg_tables WHERE tablename = '${_togrant_object_only}'",
'language_exists' => "SELECT true from pg_language WHERE lanname = '${_togrant_object_only}}'",
'language_exists' => "SELECT true from pg_language WHERE lanname = '${_togrant_object_only}'",
'role_exists' => "SELECT 1 FROM pg_roles WHERE rolname = '${role}' or '${role}' = 'PUBLIC'",
'function_exists' => "SELECT true FROM pg_proc WHERE (oid::regprocedure)::text = '${_togrant_object_only}}${arguments}'",
'function_exists' => "SELECT true FROM pg_proc WHERE (oid::regprocedure)::text = '${_togrant_object_only}${arguments}'",
default => undef,
}

Expand Down
8 changes: 0 additions & 8 deletions spec/spec_helper_acceptance_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,9 @@ def unindent
RSpec.configure do |c|
c.before :suite do
install_dependencies
turn_off_strict_error
end
end

def turn_off_strict_error
# this is only temporary fix until we finish adding support for puppet 8
# strict=warning is defaulted on puppet versions below 8, whereas puppet 8 has strict=error by default
# error is caused by 'onlyif_exists' in spec/acceptance/server/grant_spec.rb L78 (works when removed, but not what we want to test)
LitmusHelper.instance.run_shell("echo 'strict=warning\nstrict_variables=false' >> /etc/puppetlabs/puppet/puppet.conf")
end

def export_locales(locale)
LitmusHelper.instance.run_shell('echo export PATH="/opt/puppetlabs/bin:$PATH" > ~/.bashrc')
LitmusHelper.instance.run_shell('echo export LC_ALL="C" > /etc/profile.d/my-custom.lang.sh')
Expand Down