[Spacewalk-list] removing channels and packages
Joaquin Raventos
jzpian at gmail.com
Mon Feb 16 15:41:09 UTC 2009
Michiel,
Try running this script. Works for me to get rid of all the obsolete
packages. Just change the $HOST, $user, and $pass variables to match you
environment.
Thanks,
Joaquin
------------------------------------------------------------
#Start Script
#!/usr/bin/perl
use Frontier::Client;
my $HOST = 'server.domain.com';
my $user = 'user';
my $pass = 'password';
my $client = new Frontier::Client(url => "http://$HOST/rpc/api");
my $session = $client->call('auth.login',$user, $pass);
my $channels = $client->call('channel.software.listPackagesWithoutChannel',
$session);
foreach my $channel (@$channels)
{
print "Deleting orphaned package: ".$channel->{'name'}."\n";
$client->call('packages.removePackage', $session, $channel->{'id'} );
}
$client->call('auth.logout', $session);
#End Script
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20090216/90fe8fc2/attachment.htm>
More information about the Spacewalk-list
mailing list