[Spacewalk-list] archiveAction method
Jason M. Nielsen
jnielsen at myriad.com
Fri Oct 7 18:32:32 UTC 2011
This finds and lists the actions as expected. It appears to submit them
properly but the actions simply vanish after archiving from the command
line when using the archiveActions method.
Can someone explain what I am doing incorrectly? Thanks!
#!/usr/bin/python
import getpass
import xmlrpclib
import sys
import time
from time import strftime
#Example: archive_actions_later_than.py 20110510T11:00:00
SATELLITE_URL = "https://spacewalk/rpc/api"
SATELLITE_LOGIN = "Administrator"
SATELLITE_PASSWORD = getpass.getpass(prompt='Password: ')
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)
#time = time.strptime(sys.argv[1],"%Y%m%dT%H:%M:%S")
time = sys.argv[1]
action_ids = []
completed_actions = client.schedule.listCompletedActions(key)
for action in completed_actions:
if (action.get('earliest') < time):
action_ids.append(action.get('id'))
if action_ids:
print "Archiving:", action_ids
if client.schedule.archiveActions(key,action_ids):
print "Actions archival successful."
else:
print "Action archival failed."
else:
print "No actions found to archive."
client.auth.logout(key)
More information about the Spacewalk-list
mailing list