I am trying to create a python script that interfaces with RHN Satellite's API. The code below schedules a remote command to be run instantly against the specified server( var id). The problem is that the Satellite server schedules the command exactly 2 hours after I specify. I cannot find where this is taking place. The Satellite server and clients are all RHEL6. Here is my code:
#!/bin/python
import xmlrpclib
from datetime import date, datetime, time, timedelta
from sys import argv
import socket
import os
SATELLITE_URL = "https://URL"
SATELLITE_LOGIN = "username"
SATELLITE_PASSWORD = "password"
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)
id = [] #Satellite server ID
script = "#!/bin/sh \n yum update -y"
def schedule_script():
earliest_occurrence = xmlrpclib.DateTime()
print earliest_occurrence
client.system.scheduleScriptRun(key, id, "root", "root", 300, script, earliest_occurrence)
schedule_script()
client.auth.logout(key)
When I print the variable "earliest_occurrence" it prints the current time. When I do a "date" on the Satellite server it prints the correct time.
Any help would be greatly appreciated. Thanks!