示例#1
0
def updateHardware():
    s = rpcServer.getServer()


    hardwareList = hardware.Hardware()
    s.registration.refresh_hw_profile(up2dateAuth.getSystemId(),
                                          hardwareList)
示例#2
0
def login(systemId=None):
    server = rpcServer.getServer()
    log = up2dateLog.initLog()

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

    if systemId == None:
        systemId = getSystemId()

    if not systemId:
        return None

    maybeUpdateVersion()
    log.log_me("logging into up2date server")

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

    global loginInfo
    try:
        li = rpcServer.doCall(server.up2date.login, systemId)
    except rpclib.Fault, f:
        if abs(f.faultCode) == 49:
            #            print f.faultString
            raise up2dateErrors.AbuseError(f.faultString)
        else:
            raise f
示例#3
0
def login(systemId=None):
    server = rpcServer.getServer()
    log = up2dateLog.initLog()

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

    if systemId == None:
        systemId = getSystemId()

    if not systemId:
        return None
        
    maybeUpdateVersion()
    log.log_me("logging into up2date server")

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

    global loginInfo
    try:
        li = rpcServer.doCall(server.up2date.login, systemId)
    except rpclib.Fault, f:
        if abs(f.faultCode) == 49:
#            print f.faultString
            raise up2dateErrors.AbuseError(f.faultString)
        else:
            raise f
示例#4
0
def login(systemId=None):
    server = rpcServer.getServer()
    log = rhnLog.initLog()

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

    if systemId == None:
        systemId = getSystemId()

    if not systemId:
        return None

    maybeUpdateVersion()
    log.log_me("logging into up2date server")

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

    global loginInfo, loginTime, loginOffset
    try:
        loginInfo = rpcServer.doCall(server.up2date.login, systemId)
        loginTime = time.time()
        loginOffset = float(loginInfo['X-RHN-Auth-Expire-Offset']) - 60.0
    except xmlrpclib.Fault, f:
        if abs(f.faultCode) == 49:
            #            print f.faultString
            raise rhnErrors.AbuseError(f.faultString)
        else:
            raise f
示例#5
0
def getChannelDetails():

    channels = []
    sourceChannels = getChannels()

    useRhn = None
    for sourceChannel in sourceChannels.channels():
        if sourceChannel["type"] == "up2date":
            useRhn = 1

    if useRhn:
        s = rpcServer.getServer()
        up2dateChannels = rpcServer.doCall(s.up2date.listChannels, up2dateAuth.getSystemId())

    for sourceChannel in sourceChannels.channels():
        if sourceChannel["type"] != "up2date":
            # FIMXE: kluge since we dont have a good name, maybe be able to fix
            sourceChannel["name"] = sourceChannel["label"]
            sourceChannel["description"] = "%s channel %s from  %s" % (
                sourceChannel["type"],
                sourceChannel["label"],
                sourceChannel["url"],
            )
            channels.append(sourceChannel)
            continue

        if useRhn:
            for up2dateChannel in up2dateChannels:
                if up2dateChannel["label"] != sourceChannel["label"]:
                    continue
                for key in up2dateChannel.keys():
                    sourceChannel[key] = up2dateChannel[key]
                channels.append(sourceChannel)

    return channels
示例#6
0
def login(systemId=None):
    server = rpcServer.getServer()
    log = rhnLog.initLog()

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

    if systemId == None:
        systemId = getSystemId()

    if not systemId:
        return None
        
    maybeUpdateVersion()
    log.log_me("logging into up2date server")

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

    global loginInfo, loginTime, loginOffset
    try:
        loginInfo = rpcServer.doCall(server.up2date.login, systemId)
        loginTime = time.time()
        loginOffset = float(loginInfo['X-RHN-Auth-Expire-Offset']) - 60.0
    except xmlrpclib.Fault, f:
        if abs(f.faultCode) == 49:
#            print f.faultString
            raise rhnErrors.AbuseError(f.faultString)
        else:
            raise f
示例#7
0
def getChannelDetails():

    channels = []
    sourceChannels = getChannels()

    useRhn = None
    for sourceChannel in sourceChannels.channels():
        if sourceChannel['type'] == "up2date":
            useRhn = 1

    if useRhn:
        s = rpcServer.getServer()
        up2dateChannels = rpcServer.doCall(s.up2date.listChannels,
                                           up2dateAuth.getSystemId())

    for sourceChannel in sourceChannels.channels():
        if sourceChannel['type'] != 'up2date':
            # FIMXE: kluge since we dont have a good name, maybe be able to fix
            sourceChannel['name'] = sourceChannel['label']
            sourceChannel['description'] = "%s channel %s from  %s" % (
                sourceChannel['type'], sourceChannel['label'],
                sourceChannel['url'])
            channels.append(sourceChannel)
            continue

        if useRhn:
            for up2dateChannel in up2dateChannels:
                if up2dateChannel['label'] != sourceChannel['label']:
                    continue
                for key in up2dateChannel.keys():
                    sourceChannel[key] = up2dateChannel[key]
                channels.append(sourceChannel)

    return channels
示例#8
0
def getAdvisoryInfo(pkg, warningCallback=None):
    log = up2dateLog.initLog()
    cfg = config.initUp2dateConfig()
    # no errata for non rhn use
    if not cfg['useRhn']:
        return None

    s = rpcServer.getServer()

    ts = transaction.initReadOnlyTransaction()
    mi = ts.dbMatch('Providename', pkg[0])
    if not mi:
        return None

    # odd,set h to last value in mi. mi has to be iterated
    # to get values from it...
    h = None
    for h in mi:
        break

    info = None

    # in case of package less errata that somehow apply
    if h:
        try:
            pkgName = "%s-%s-%s" % (h['name'], h['version'], h['release'])
            log.log_me("getAdvisoryInfo for %s" % pkgName)
            info = rpcServer.doCall(s.errata.getPackageErratum,
                                    up2dateAuth.getSystemId(), pkg)
        except rpclib.Fault, f:
            if warningCallback:
                warningCallback(f.faultString)
            return None
示例#9
0
def subscribeChannels(channels, username, passwd):
    s = rpcServer.getServer()
    try:
        channels = rpcServer.doCall(s.up2date.subscribeChannels, up2dateAuth.getSystemId(), channels, username, passwd)
    except rpclib.Fault, f:
        if f.faultCode == -36:
            raise up2dateErrors.PasswordError(f.faultString)
        else:
            raise up2dateErrors.CommunicationError(f.faultString)
示例#10
0
def termsAndConditions():
    s = rpcServer.getServer()

    try:
        return rpcServer.doCall(s.registration.terms_and_conditions)
    except rpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#11
0
def privacyText():
    s = rpcServer.getServer()

    try:
        return rpcServer.doCall(s.registration.privacy_statement)
    except rpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#12
0
def welcomeText():
    s = rpcServer.getServer()

    try:
        return rpcServer.doCall(s.registration.welcome_message)
    except rpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#13
0
def updatePackages(systemId, packageList):
    s = rpcServer.getServer()

    try:
        rpcServer.doCall(s.registration.update_packages, systemId, packageList)
    except xmlrpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#14
0
def privacyText():
    s = rpcServer.getServer()

    try:
        return rpcServer.doCall(s.registration.privacy_statement)
    except xmlrpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#15
0
def termsAndConditions():
    s = rpcServer.getServer()

    try:
        return rpcServer.doCall(s.registration.terms_and_conditions)
    except xmlrpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#16
0
def welcomeText():
    s = rpcServer.getServer()

    try:
        return rpcServer.doCall(s.registration.welcome_message)
    except xmlrpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#17
0
def getCaps():
    s = rpcServer.getServer()

    try:
        rpcServer.doCall(s.registration.welcome_message)
    except xmlrpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise f
示例#18
0
def sendHardware(systemId, hardwareList):
    s = rpcServer.getServer()

    try:
        rpcServer.doCall(s.registration.add_hw_profile, systemId, hardwareList)
    except xmlrpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#19
0
def listPackages(systemId):
    s = rpcServer.getServer()

    try:
        rpcServer.doCall(s.registration.list_packages,systemId)
    except rpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#20
0
def listPackages(systemId):
    s = rpcServer.getServer()

    try:
        rpcServer.doCall(s.registration.list_packages, systemId)
    except xmlrpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#21
0
def sendHardware(systemId, hardwareList):
    s = rpcServer.getServer()

    try:
        rpcServer.doCall(s.registration.add_hw_profile, systemId, hardwareList)
    except rpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#22
0
def registerProduct(systemId, productInfo):
    s = rpcServer.getServer()

    try:
        rpcServer.doCall(s.registration.register_product, systemId,
                         productInfo)
    except xmlrpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#23
0
def getCaps():
    s = rpcServer.getServer()

    
    try:
        rpcServer.doCall(s.registration.welcome_message)
    except rpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise f
示例#24
0
def unsubscribeChannels(channels, username, passwd):
    s = rpcServer.getServer()
    try:
        channels = rpcServer.doCall(s.up2date.unsubscribeChannels,
                                    up2dateAuth.getSystemId(), channels,
                                    username, passwd)
    except rpclib.Fault, f:
        if f.faultCode == -36:
            raise up2dateErrors.PasswordError(f.faultString)
        else:
            raise up2dateErrors.CommunicationError(f.faultString)
示例#25
0
def registerProduct(systemId, productInfo, oemInfo={}):
    s = rpcServer.getServer()

    try:
        rpcServer.doCall(s.registration.register_product,
                         systemId, productInfo)
    except rpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#26
0
def validateRegNum(regNum):
    s = rpcServer.getServer()

    try:
        rpcServer.doCall(s.registration.validate_reg_num,regNum)
    except rpclib.Fault, f:
        if f.faultCode == -16:
            # invalid
            raise rhnErrors.ValidationError(f.faultString)
        elif f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#27
0
def validateRegNum(regNum):
    s = rpcServer.getServer()

    try:
        rpcServer.doCall(s.registration.validate_reg_num, regNum)
    except xmlrpclib.Fault, f:
        if f.faultCode == -16:
            # invalid
            raise rhnErrors.ValidationError(f.faultString)
        elif f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#28
0
def sendSerialNumber(systemId, num):
    s = rpcServer.getServer()

    try:
        if cfg["oemId"] != None:
            rpcServer.doCall(s.registration.send_serial, systemId, num,
                                       cfg["oemId"])
        else:
            rpcServer.doCall(s.registration.send_serial, systemId, num)
    except rpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#29
0
def finishMessage(systemId):

#    ret =  (-1, "blippyFoobar", "this is some text\n\n\nmore\n\ntext\\n\nfoo")
#    return ret

    s = rpcServer.getServer()
    try:
        ret =  rpcServer.doCall(s.registration.finish_message, systemId)
        return ret
    except rpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#30
0
def finishMessage(systemId):

    #    ret =  (-1, "blippyFoobar", "this is some text\n\n\nmore\n\ntext\\n\nfoo")
    #    return ret

    s = rpcServer.getServer()
    try:
        ret = rpcServer.doCall(s.registration.finish_message, systemId)
        return ret
    except xmlrpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#31
0
def sendSerialNumber(systemId, num):
    s = rpcServer.getServer()

    try:
        if cfg["oemId"] != None:
            rpcServer.doCall(s.registration.send_serial, systemId, num,
                             cfg["oemId"])
        else:
            rpcServer.doCall(s.registration.send_serial, systemId, num)
    except xmlrpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#32
0
def registerUser(username, password, email=None, orgid=None, orgpassword=None):
    s = rpcServer.getServer()

    try:
        if not email == None:
            if orgid and orgpassword:
                rpcServer.doCall(s.registration.new_user, username, password,
                                 email, orgid, orgpassword)
            else:
                rpcServer.doCall(s.registration.new_user, username, password,
                                 email)
        else:
            rpcServer.doCall(s.registration.new_user, username, password)
    except xmlrpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#33
0
def maybeUpdateVersion():
    cfg = config.initUp2dateConfig()
    try:
        idVer = rpclib.xmlrpclib.loads(getSystemId())[0][0]['os_release']
    except:
        # they may not even have a system id yet.
        return 0

    systemVer = up2dateUtils.getVersion()
    
    if idVer != systemVer:
      s = rpcServer.getServer()
    
      try:
          newSystemId = rpcServer.doCall(s.registration.upgrade_version,
                                         getSystemId(), systemVer)
      except rpclib.Fault, f:
          raise up2dateErrors.CommunicationError(f.faultString)

      path = cfg["systemIdPath"]
      dir = path[:string.rfind(path, "/")]
      if not os.access(dir, os.W_OK):
          try:
              os.mkdir(dir)
          except:
              return 0
      if not os.access(dir, os.W_OK):
          return 0

      if os.access(path, os.F_OK):
          # already have systemid file there; let's back it up
          savePath = path + ".save"
          try:
              os.rename(path, savePath)
          except:
              return 0

      f = open(path, "w")
      f.write(newSystemId)
      f.close()
      try:
          os.chmod(path, 0600)
      except:
          pass
示例#34
0
def maybeUpdateVersion():
    cfg = config.initUp2dateConfig()
    try:
        idVer = rpclib.xmlrpclib.loads(getSystemId())[0][0]['os_release']
    except:
        # they may not even have a system id yet.
        return 0

    systemVer = up2dateUtils.getVersion()

    if idVer != systemVer:
        s = rpcServer.getServer()

        try:
            newSystemId = rpcServer.doCall(s.registration.upgrade_version,
                                           getSystemId(), systemVer)
        except rpclib.Fault, f:
            raise up2dateErrors.CommunicationError(f.faultString)

        path = cfg["systemIdPath"]
        dir = path[:string.rfind(path, "/")]
        if not os.access(dir, os.W_OK):
            try:
                os.mkdir(dir)
            except:
                return 0
        if not os.access(dir, os.W_OK):
            return 0

        if os.access(path, os.F_OK):
            # already have systemid file there; let's back it up
            savePath = path + ".save"
            try:
                os.rename(path, savePath)
            except:
                return 0

        f = open(path, "w")
        f.write(newSystemId)
        f.close()
        try:
            os.chmod(path, 0600)
        except:
            pass
示例#35
0
def registerSystem(username=None,
                   password=None,
                   profileName=None,
                   packages=None,
                   token=None,
                   other=None):
    s = rpcServer.getServer()

    auth_dict = {
        "profile_name": profileName,
        "os_release": rhnUtils.getVersion(),
        "release_name": rhnUtils.getOSRelease(),
        "architecture": rhnUtils.getArch()
    }

    # dict of other bits to send up
    if other:
        for (key, item) in other.items():
            auth_dict[key] = item

    if token:
        auth_dict["token"] = token
    else:
        auth_dict["username"] = username
        auth_dict["password"] = password

    auth_dict["uuid"] = cfg["uuid"] or ""
    auth_dict["rhnuuid"] = cfg["rhnuuid"] or ""

    try:
        if packages == None:
            ret = rpcServer.doCall(s.registration.new_system, auth_dict)
        else:
            ret = rpcServer.doCall(s.registration.new_system, auth_dict,
                                   packages)
    except xmlrpclib.Fault, f:
        if abs(f.faultCode) == 99:
            raise rhnErrors.DelayError(f.faultString)
        elif abs(f.faultCode) == 60:
            raise rhnErrors.AuthenticationTicketError(f.faultString)
        elif abs(f.faultCode) == 105:
            raise rhnErrors.RhnUuidUniquenessError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#36
0
def reserveUser(username, password):
    s = rpcServer.getServer()
    
    try:
        ret = rpcServer.doCall(s.registration.reserve_user, username, password)
    except rpclib.Fault, f:
        if f.faultCode == -3:
            # account already in use
            raise rhnErrors.ValidationError(f.faultString)
        elif f.faultCode == -14:
            # too short password
            raise rhnErrors.ValidationError(f.faultString)
        elif f.faultCode == -15:
            # bad chars in username
            raise rhnErrors.ValidationError(f.faultString)
        elif f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#37
0
def registerSystem(username = None, password = None,
                   profileName = None, packages = None,
                   token = None, other = None):
    s = rpcServer.getServer()

    auth_dict =  { "profile_name" : profileName,
                   "os_release" : rhnUtils.getVersion(),
		   "release_name" : rhnUtils.getOSRelease(),
                   "architecture" : rhnUtils.getArch() };

    # dict of other bits to send up
    if other:
        for (key, item) in other.items():
            auth_dict[key] = item

    if token:
        auth_dict["token"] = token
    else:
        auth_dict["username"] = username
        auth_dict["password"] = password


    auth_dict["uuid"] = cfg["uuid"] or ""
    auth_dict["rhnuuid"] = cfg["rhnuuid"] or ""
    

    try:
        if packages == None:
            ret = rpcServer.doCall(s.registration.new_system,
                         auth_dict)
        else:
            ret = rpcServer.doCall(s.registration.new_system,
                         auth_dict,
                         packages)
    except rpclib.Fault, f:
        if abs(f.faultCode) == 99:
            raise rhnErrors.DelayError(f.faultString)
        elif abs(f.faultCode) == 60:
            raise rhnErrors.AuthenticationTicketError(f.faultString)
        elif abs(f.faultCode) == 105:
            raise rhnErrors.RhnUuidUniquenessError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#38
0
def reserveUser(username, password):
    s = rpcServer.getServer()

    try:
        ret = rpcServer.doCall(s.registration.reserve_user, username, password)
    except xmlrpclib.Fault, f:
        if f.faultCode == -3:
            # account already in use
            raise rhnErrors.ValidationError(f.faultString)
        elif f.faultCode == -14:
            # too short password
            raise rhnErrors.ValidationError(f.faultString)
        elif f.faultCode == -15:
            # bad chars in username
            raise rhnErrors.ValidationError(f.faultString)
        elif f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#39
0
def registerUser(username, password,
                 email = None, orgid = None, orgpassword = None):
    s = rpcServer.getServer()

    try:
        if not email == None:
            if orgid and orgpassword:
                rpcServer.doCall(s.registration.new_user,
                                 username, password, email, orgid, orgpassword)
            else:
                rpcServer.doCall(s.registration.new_user,
                                 username, password, email)
        else:
                rpcServer.doCall(s.registration.new_user, username, password)
    except rpclib.Fault, f:
        if f.faultCode == 99:
            raise rhnErrors.DelayError(f.faultString)
        else:
            raise rhnErrors.CommunicationError(f.faultString)
示例#40
0
def getAdvisoryInfo(pkg, warningCallback=None):
    log = up2dateLog.initLog()
    cfg = config.initUp2dateConfig()
    # no errata for non rhn use
    if not cfg['useRhn']:
        return None
        
    s = rpcServer.getServer()

    ts = transaction.initReadOnlyTransaction()
    mi = ts.dbMatch('Providename', pkg[0])
    if not mi:
	return None

    # odd,set h to last value in mi. mi has to be iterated
    # to get values from it...
    h = None
    for h in mi:
        break

    info = None

    # in case of package less errata that somehow apply
    if h:
        try:
            pkgName = "%s-%s-%s" % (h['name'],
                                h['version'],
                                h['release'])
            log.log_me("getAdvisoryInfo for %s" % pkgName)
            info = rpcServer.doCall(s.errata.getPackageErratum,
                                    up2dateAuth.getSystemId(),
                                    pkg)
        except rpclib.Fault, f:
            if warningCallback:
                warningCallback(f.faultString)
            return None
示例#41
0
import xmlrpclib
import rpcServer
import hardware



def updateHardware():
    registered =  rhnAuth.getSystemId()
    if not registered:
        print "system not registered"
        sys.exit(1)

    try:
        rhnAuth.updateLoginInfo()
    except xmlrpclib.Fault, f:
        faultError(f.faultString)
        sys.exit(1)
    except rhnErrors.ServerCapabilityError, e:
        print e
        sys.exit(1)
    except rhnErrors.CommunicationError, e:
        print e
        sys.exit(1)

    #print _("Updating package profile...")

    s = rpcServer.getServer()

    hardwareList = hardware.Hardware()
    s.registration.refresh_hw_profile(registered, hardwareList)
示例#42
0
 def __init__(self, serverOverride=None, timeout=None):
     self._server = rpcServer.getServer(serverOverride=serverOverride,
                                        timeout=timeout)
     self._capabilities = None
示例#43
0
 def __init__(self, serverOverride=None, timeout=None):
     self._server = rpcServer.getServer(serverOverride=serverOverride,
             timeout=timeout)
     self._capabilities = None
示例#44
0
    from rhn import rpclib
except ImportError:
    rpclib = __import__("xmlrpclib")



def updateHardware():
    registered =  rhnAuth.getSystemId()
    if not registered:
        print "system not registered"
        sys.exit(1)

    try:
        rhnAuth.updateLoginInfo()
    except rpclib.Fault, f:
        faultError(f.faultString)
        sys.exit(1)
    except rhnErrors.ServerCapabilityError, e:
        print e
        sys.exit(1)
    except rhnErrors.CommunicationError, e:
        print e
        sys.exit(1)

    #print _("Updating package profile...")

    s = rpcServer.getServer()
    
    hardwareList = hardware.Hardware()
    s.registration.refresh_hw_profile(registered, hardwareList)
示例#45
0
 def __init__(self):
     self._server = rpcServer.getServer()
     self._capabilities = None
示例#46
0
 def __init__(self):
     self._server = rpcServer.getServer()
     self._capabilities = None