[Spacewalk-list] remove a profile from the command line

Armstrong, Kenneth Lawrence (SYSADMIN) klarmstrong2 at liberty.edu
Tue Sep 24 13:54:08 UTC 2013


Cool, thanks.

I slapped together a python script to handle this:

#!/usr/bin/python

import xmlrpclib
import sys

# get the API from the Satellite server
SATELLITE_URL = "https://satellite.example.com/rpc/api"
SATELLITE_LOGIN = "APIUser"
SATELLITE_PASSWORD = "password"

client = xmlrpclib.Server(SATELLITE_URL, verbose=0)

key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)

def main():
    # Delete any Kickstart profiles passed via the command line
    for arg in sys.argv[1:]:
        if arg == '--help':
            print ''
            print 'Pass a Kickstart label to delete it.'
            print 'Example: rhn_cleanup Tester'
            print ''
        else:
            client.kickstart.deleteProfile(key,arg)

if __name__ == "__main__":
    main()

# close out the connection to the API
client.auth.logout(key)

-----Original Message-----
From: spacewalk-list-bounces at redhat.com [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Milan Zazrivec
Sent: Tuesday, September 24, 2013 9:07 AM
To: spacewalk-list at redhat.com
Subject: Re: [Spacewalk-list] remove a profile from the command line

> Hi all.
> 
> How can I remove a Kickstart profile completely from the command line? 
> I've tried the following:
> 
> cobbler profile remove --name=tester:1:OurOrg

This won't help, since Spacewalk will re-sync that profile after a while to cobbler again.

> However, after a few moments it reappears in the web UI.  I imagine 
> that the Oracle database is still holding the information too, so what 
> can I do to remove a profile from the command line without using the web interface?

Using API: kickstart.deleteProfile()

-MZ

_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list




More information about the Spacewalk-list mailing list