Skip to content

Commit

Permalink
Use pulpcore-manager
Browse files Browse the repository at this point in the history
This requires at least Pulp 3.2.0, but since
f59265e that's been the required
minimum version.
  • Loading branch information
ekohl committed Jul 14, 2020
1 parent 4ba1170 commit cbd0e8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 35 deletions.
14 changes: 3 additions & 11 deletions manifests/admin.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @summary Run a python3-django-admin command
# @summary Run a pulpcore-manager command
#
# @param command
# The command to run
Expand All @@ -15,9 +15,6 @@
# The path to look for commands.
#
# @param pulp_settings
# The pulp settings file to use
#
# @param static_root
# Root directory for static content
#
# @see exec
Expand All @@ -27,16 +24,11 @@
Optional[String] $unless = undef,
Array[Stdlib::Absolutepath] $path = ['/usr/bin'],
Stdlib::Absolutepath $pulp_settings = $pulpcore::settings_file,
Stdlib::Absolutepath $static_root = $pulpcore::pulp_static_root,
) {
Concat <| title == 'pulpcore settings' |>
-> exec { "python3-django-admin ${command}":
-> exec { "pulpcore-manager ${command}":
path => $path,
environment => [
'DJANGO_SETTINGS_MODULE=pulpcore.app.settings',
"PULP_SETTINGS=${pulp_settings}",
"PULP_STATIC_ROOT=${static_root}",
],
environment => ["PULP_SETTINGS=${pulp_settings}"],
refreshonly => $refreshonly,
unless => $unless,
}
Expand Down
6 changes: 0 additions & 6 deletions spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,6 @@
it do
is_expected.to compile.with_all_deps
is_expected.to contain_file('/my/custom/directory')
is_expected.to contain_exec('python3-django-admin collectstatic --noinput')
.with_environment([
"DJANGO_SETTINGS_MODULE=pulpcore.app.settings",
"PULP_SETTINGS=/etc/pulp/settings.py",
"PULP_STATIC_ROOT=/my/other/custom/directory"
])
is_expected.to contain_systemd__unit_file('pulpcore-api.service')
.with_content(%r{Environment="PULP_STATIC_ROOT=/my/other/custom/directory"})
is_expected.to contain_apache__vhost('pulpcore')
Expand Down
22 changes: 4 additions & 18 deletions spec/defines/admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,18 @@
let(:facts) { os_facts }
let(:title) { 'help' }

context 'with a fixed pulp_settings and static_root' do
context 'with a fixed pulp_settings' do
let(:params) do
{
pulp_settings: '/etc/pulpcore/settings.py',
static_root: '/var/lib/pulp/assets',
}
end

context 'default parameters' do
it do
is_expected.to compile.with_all_deps
is_expected.to contain_exec('python3-django-admin help')
.with_environment([
'DJANGO_SETTINGS_MODULE=pulpcore.app.settings',
'PULP_SETTINGS=/etc/pulpcore/settings.py',
'PULP_STATIC_ROOT=/var/lib/pulp/assets',
])
.with_environment(['PULP_SETTINGS=/etc/pulpcore/settings.py'])
.with_refreshonly(false)
.with_unless(nil)
end
Expand All @@ -34,18 +29,13 @@
command: 'migrate --noinput',
refreshonly: true,
unless: '/usr/bin/false',
static_root: '/var/lib/pulp/assets',
)
end

it do
is_expected.to compile.with_all_deps
is_expected.to contain_exec('python3-django-admin migrate --noinput')
.with_environment([
'DJANGO_SETTINGS_MODULE=pulpcore.app.settings',
'PULP_SETTINGS=/etc/pulpcore/settings.py',
'PULP_STATIC_ROOT=/var/lib/pulp/assets',
])
.with_environment(['PULP_SETTINGS=/etc/pulpcore/settings.py'])
.with_refreshonly(true)
.with_unless('/usr/bin/false')
end
Expand All @@ -61,11 +51,7 @@
is_expected.to contain_pulpcore__admin('help').with_pulp_settings('/etc/pulp/settings.py')
is_expected.to contain_concat('pulpcore settings')
is_expected.to contain_exec('python3-django-admin help')
.with_environment([
'DJANGO_SETTINGS_MODULE=pulpcore.app.settings',
'PULP_SETTINGS=/etc/pulp/settings.py',
'PULP_STATIC_ROOT=/var/lib/pulp/assets',
])
.with_environment(['PULP_SETTINGS=/etc/pulp/settings.py'])
.with_refreshonly(false)
.with_unless(nil)
.that_requires('Concat[pulpcore settings]')
Expand Down

0 comments on commit cbd0e8e

Please sign in to comment.