Package up2date_client :: Module rhnreg
[hide private]
[frames] | no frames]

Module rhnreg

source code

Classes [hide private]
  long
int(x=0) -> int or long int(x, base=10) -> int or long
  RegistrationResult
  ActivationResult
Functions [hide private]
 
startRhnsd() source code
 
getOemInfo() source code
 
rhsm_registered()
Returns true if system is registred using subscription manager
source code
 
registered() source code
 
createSystemRegisterRemindFile() source code
 
removeSystemRegisterRemindFile() source code
 
_write_secure_file(secure_file, file_contents)
Write a file to disk that is not readable by other users.
source code
 
writeSystemId(systemId) source code
 
writeHWCode(hw_activation_code)
Returns True if the write is successful or False if it fails.
source code
 
get_virt_info()
This function returns the UUID and virtualization type of this system, if it is a guest.
source code
 
get_para_virt_info()
This function checks /sys/hypervisor/uuid to see if the system is a para-virt guest.
source code
 
get_fully_virt_info()
This function looks in the SMBIOS area to determine if this is a fully-virt guest.
source code
 
_is_host_uuid(uuid) source code
 
welcomeText() source code
 
getCaps() source code
 
reserveUser(username, password) source code
 
registerSystem(username=None, password=None, profileName=None, token=None, other=None)
Wrapper for the old xmlrpc to register a system.
source code
 
updateRhsmStatus() source code
 
getAvailableChannels(username, password) source code
 
registerSystem2(username=None, password=None, profileName=None, packages=None, activationKey=None, other={})
Uses the new xmlrpcs to register a system.
source code
 
server_supports_eus() source code
 
sendHardware(systemId, hardwareList) source code
 
sendPackages(systemId, packageList) source code
 
sendVirtInfo(systemId) source code
 
listPackages(systemId) source code
 
makeNiceServerUrl(server)
Raises up2dateErrors.InvalidProtocolError if the server url has a protocol specified and it's not http or https.
source code
 
getServerType(serverUrl=None)
Returns 'hosted' if the url points to a known hosted server.
source code
 
_encode_characters(*args)
All the data we gathered from dmi, bios, gudev are in utf-8, we need to convert characters beyond ord(127) - e.g ® to unicode.
source code
 
_activate_hardware(login, password) source code
 
activateHardwareInfo(username, password, hardwareInfo, orgId=None)
Tries to activate an entitlement linked to the hardware info that we read from the bios.
source code
 
spawnRhnCheckForUI() source code
Variables [hide private]
  support = None
hash(x)
  t = gettext.translation('rhn-client-tools', fallback= True)
  SYSID_DIR = '/etc/sysconfig/rhn'
  REMIND_FILE = '/etc/sysconfig/rhn/rhn_register_remind'
  HW_CODE_FILE = '/etc/sysconfig/rhn/hw-activation-code'
  RHSM_FILE = '/etc/pki/consumer/cert.pem'
  cfg = config.initUp2dateConfig()
  log = up2dateLog.initLog()
  __package__ = 'up2date_client'
Function Details [hide private]

get_virt_info()

source code 

This function returns the UUID and virtualization type of this system, if it is a guest. Otherwise, it returns None. To figure this out, we'll use a number of heuristics (list in order of precedence):

  1. Check /proc/xen/xsd_port. If exists, we know the system is a host; exit.
  2. Check SMBIOS. If vendor='Xen' and UUID is non-zero, we know the system is a fully-virt guest; exit.
  3. Check /sys/hypervisor/uuid. If exists and is non-zero, we know the system is a para-virt guest; exit.
  4. If non of the above checks worked; we know we have a non-xen-enabled system; exit.

get_para_virt_info()

source code 

This function checks /sys/hypervisor/uuid to see if the system is a para-virt guest. It returns a (uuid, virt_type) tuple.

get_fully_virt_info()

source code 

This function looks in the SMBIOS area to determine if this is a fully-virt guest. It returns a (uuid, virt_type) tuple.

registerSystem(username=None, password=None, profileName=None, token=None, other=None)

source code 

Wrapper for the old xmlrpc to register a system. Activates subscriptions if a reg num is given.

registerSystem2(username=None, password=None, profileName=None, packages=None, activationKey=None, other={})

source code 

Uses the new xmlrpcs to register a system. Returns a dict instead of just system id.

The main differences between this and registerSystem and that this doesn't do activation and does child channel subscriptions if possible. See the documentation for the xmlrpc handlers in backend for more detail.

If nothing is going to be in other, it can be {} or None.

New in RHEL 5.

getServerType(serverUrl=None)

source code 

Returns 'hosted' if the url points to a known hosted server. Otherwise returns 'satellite'.

activateHardwareInfo(username, password, hardwareInfo, orgId=None)

source code 
Tries to activate an entitlement linked to the hardware info that we
read from the bios.

Returns an ActivationResult.
Can raise:
    Invalid number.
    Hardware info is not entitling.
    Communication errors, etc