diff --git a/manifests/admin.pp b/manifests/admin.pp index c1e2e070..8b8c5403 100644 --- a/manifests/admin.pp +++ b/manifests/admin.pp @@ -1,4 +1,4 @@ -# @summary Run a python3-django-admin command +# @summary Run a pulpcore-manager command # # @param command # The command to run @@ -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 @@ -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, } diff --git a/manifests/database.pp b/manifests/database.pp index 9492b1b9..5e1afe4a 100644 --- a/manifests/database.pp +++ b/manifests/database.pp @@ -12,12 +12,12 @@ } pulpcore::admin { 'migrate --noinput': - unless => 'python3-django-admin migrate --plan | grep "No planned migration operations"', + unless => 'pulpcore-manager migrate --plan | grep "No planned migration operations"', refreshonly => false, } pulpcore::admin { 'reset-admin-password --random': - unless => 'python3-django-admin dumpdata auth.User | grep "auth.user"', + unless => 'pulpcore-manager dumpdata auth.User | grep "auth.user"', refreshonly => false, require => Pulpcore::Admin['migrate --noinput'], } diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb index b6919b65..244a185b 100644 --- a/spec/acceptance/basic_spec.rb +++ b/spec/acceptance/basic_spec.rb @@ -66,7 +66,7 @@ class { 'pulpcore': its(:exit_status) { is_expected.to eq 0 } end - describe command("DJANGO_SETTINGS_MODULE=pulpcore.app.settings PULP_SETTINGS=/etc/pulp/settings.py python3-django-admin dumpdata auth.User") do + describe command("PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager dumpdata auth.User") do its(:stdout) { is_expected.to match(/auth\.user/) } its(:exit_status) { is_expected.to eq 0 } end diff --git a/spec/classes/pulpcore_spec.rb b/spec/classes/pulpcore_spec.rb index e735b5e1..4010ae00 100644 --- a/spec/classes/pulpcore_spec.rb +++ b/spec/classes/pulpcore_spec.rb @@ -35,9 +35,9 @@ is_expected.to contain_class('postgresql::server') is_expected.to contain_postgresql__server__db('pulpcore') is_expected.to contain_pulpcore__admin('migrate --noinput') - is_expected.to contain_exec('python3-django-admin migrate --noinput') + is_expected.to contain_exec('pulpcore-manager migrate --noinput') is_expected.to contain_pulpcore__admin('reset-admin-password --random') - is_expected.to contain_exec('python3-django-admin reset-admin-password --random') + is_expected.to contain_exec('pulpcore-manager reset-admin-password --random') end it 'configures apache' do @@ -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') diff --git a/spec/defines/admin_spec.rb b/spec/defines/admin_spec.rb index 4ad6157a..e880a0e4 100644 --- a/spec/defines/admin_spec.rb +++ b/spec/defines/admin_spec.rb @@ -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', - ]) + is_expected.to contain_exec('pulpcore-manager help') + .with_environment(['PULP_SETTINGS=/etc/pulpcore/settings.py']) .with_refreshonly(false) .with_unless(nil) end @@ -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', - ]) + is_expected.to contain_exec('pulpcore-manager migrate --noinput') + .with_environment(['PULP_SETTINGS=/etc/pulpcore/settings.py']) .with_refreshonly(true) .with_unless('/usr/bin/false') end @@ -60,12 +50,8 @@ is_expected.to compile.with_all_deps 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', - ]) + is_expected.to contain_exec('pulpcore-manager help') + .with_environment(['PULP_SETTINGS=/etc/pulp/settings.py']) .with_refreshonly(false) .with_unless(nil) .that_requires('Concat[pulpcore settings]')