Skip to content

Instantly share code, notes, and snippets.

@indygwyn
Forked from tchellomello/pulp-admin.sh
Created January 28, 2019 19:24
Show Gist options
  • Select an option

  • Save indygwyn/c57463a7947601e3b4e034fd38fd2a78 to your computer and use it in GitHub Desktop.

Select an option

Save indygwyn/c57463a7947601e3b4e034fd38fd2a78 to your computer and use it in GitHub Desktop.
pulp-admin.sh
#!/bin/bash
STATE=""
for TASK in `pulp-admin tasks list | egrep '^Task Id:|^State:' | sed -e 's,^Task Id: ,,' -e 's,^State: ,,'`; do
if [ "$STATE" = "" ]; then
STATE=$TASK
else
if [ $STATE != Successful ] && [ $STATE != Cancelled ] && [ $STATE != Failed ]; then
pulp-admin tasks details --task-id=$TASK
pulp-admin tasks cancel --task-id=$TASK
fi
STATE=""
fi
done
==================
# foreman-rake console
ForemanTasks::Task.where(:state => :running).where(:label => "Actions::Katello::Host::GenerateApplicability").destroy_all
ForemanTasks::Task.where(:state => :paused).where(:label => "Actions::Katello::Host::GenerateApplicability").destroy_all
ForemanTasks::Task.where(:state => :paused).where(:label => "Actions::Katello::Repository::Sync").destroy_all
ForemanTasks::Task.where(:state => :running).where(:label => "Actions::Katello::Repository::Sync").destroy_all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment