コード例 #1
0
ファイル: rhn_check.py プロジェクト: bjmingyang/spacewalk
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
ファイル: rhn_check.py プロジェクト: bjmingyang/spacewalk
    sys.exit(1)

for (opt, val) in opts:
    if opt in ["--verbose", "-v"]:
        cfg["debug"] = cfg["debug"] + 1
    elif opt in ["--help", "-h"]:
        showHelp()
        sys.exit(0)
        
# if we're disabled, go down (almost) quietly
if os.path.exists(DISABLE_FILE):
    print "RHN service is disabled. Check %s" % DISABLE_FILE
    sys.exit(0)
    
# retrieve the system_id. This is required.
if not rhnAuth.getSystemId():
    print "ERROR: unable to read system id."
    sys.exit(-1)

# Initialize the server connection...
server = rpcServer.getServer()

# send up the capabality info
headerlist = clientCaps.caps.headerFormat()
for (headerName, value) in headerlist:
    server.add_header(headerName, value)

# the list of caps the client needs
caps = capabilities.Capabilities()