[Spacewalk-list] removing channels and packages

Wolf, Christian Christian.Wolf at foxmobile.com
Fri Feb 20 10:19:14 UTC 2009


I want to delete all fedora 10 packages. I use this script but nothing
happen. 

Script:

#Start Script

 

 

#!/usr/bin/perl

use Frontier::Client;

 

my $HOST = 'spacewalk2."domain";

my $user = 'spacewalk';

my $pass = 'spacewalk';

 

my $client = new Frontier::Client(url => "https://$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

 

Must I delete the packages at first from /var/satellite/redhat/1/ ?

or delete this script also the packages from there and from Spacewalk
UI?

If I delete from Spacewalk UI, this error will display

Service Temporarily Unavailable

The server is temporarily unable to service your request due to
maintenance downtime or capacity problems. Please try again later.

________________________________

Apache/2.2.3 (CentOS) Server at spacewalk2

 

 

Sorry for bad English

 

From: spacewalk-list-bounces at redhat.com
[mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Joaquin Raventos
Sent: Monday, February 16, 2009 4:41 PM
To: spacewalk-list at redhat.com
Subject: Re: [Spacewalk-list] removing channels and packages

 

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/20090220/dd44e0c2/attachment.htm>


More information about the Spacewalk-list mailing list