Пример #1
0
def submit_response(action_id, status, message, data):
    global server
    # try to submit
    try:
        ret = rpcServer.doCall(server.queue.submit, rhnAuth.getSystemId(), action_id, status, message, data)
    except rpclib.Fault, f:
        print "Could not submit results to server %s" % server
        print "Error code: %d%s" % (f.faultCode, f.faultString)
        sys.exit(-1)
Пример #2
0
def submit_response(action_id, status, message, data):
    global server
    # try to submit
    try:
        ret = rpcServer.doCall(server.queue.submit, rhnAuth.getSystemId(),
                               action_id, status, message, data)
    except xmlrpclib.Fault, f:
        print "Could not submit results to server %s" % server
        print "Error code: %d%s" % (f.faultCode, f.faultString)
        sys.exit(-1)
Пример #3
0
# PORTME
if os.access("/proc/uptime", os.R_OK):
    uptime = string.split(open("/proc/uptime", "r").read())
    try:
        Status["uptime"] = map(int, map(float, uptime))
    except TypeError, ValueError:
        Status["uptime"] = map(lambda a: a[:-3], uptime)
    except:
        pass

# Process all the actions we have in the queue

has_logged_in = None
while 1:
    try:
        action = rpcServer.doCall(server.queue.get,rhnAuth.getSystemId(),
                                  ACTION_VERSION, Status)
    except xmlrpclib.Fault, f:
        print "Could not retrieve action item from server %s" % server
        print "Error code: %d%s" % (f.faultCode, f.faultString)
        sys.exit(-1)
    # XXX: what if no SSL in socket?
    except socket.sslerror:
        print "ERROR: SSL handshake to %s failed" % server
        print """
        This could signal that you are *NOT* talking to a server
        whose certificate was signed by a Certificate Authority
        listed in the %s file or that the
        RHNS-CA-CERT file is invalid.""" % rhns_ca_cert
        sys.exit(-1)
    except socket.error:
	print "Could not retrieve action from %s.\n"\
Пример #4
0
# PORTME
if os.access("/proc/uptime", os.R_OK):
    uptime = string.split(open("/proc/uptime", "r").read())
    try:
        Status["uptime"] = map(int, map(float, uptime))
    except TypeError, ValueError:
        Status["uptime"] = map(lambda a: a[:-3], uptime)
    except:
        pass

# Process all the actions we have in the queue

has_logged_in = None
while 1:
    try:
        action = rpcServer.doCall(server.queue.get, rhnAuth.getSystemId(),
                                  ACTION_VERSION, Status)
    except xmlrpclib.Fault, f:
        print "Could not retrieve action item from server %s" % server
        print "Error code: %d%s" % (f.faultCode, f.faultString)
        sys.exit(-1)
    # XXX: what if no SSL in socket?
    except socket.sslerror:
        print "ERROR: SSL handshake to %s failed" % server
        print """
        This could signal that you are *NOT* talking to a server
        whose certificate was signed by a Certificate Authority
        listed in the %s file or that the
        RHNS-CA-CERT file is invalid.""" % rhns_ca_cert
        sys.exit(-1)
    except socket.error:
        print "Could not retrieve action from %s.\n"\