Package backend :: Package server :: Package rhnServer :: Module server_token
[hide private]
[frames] | no frames]

Module server_token

source code

Classes [hide private]
  ActivationTokens
An aggregation of activation tokens, exposing important information like org_id, user_id etc in a unified manner.
  ReRegistrationToken
Subclass for re-registration keys.
  ReRegistrationActivationToken
Subclass for re-registration keys and activation keys used together.
Functions [hide private]
 
token_channels(server, server_arch, tokens_obj)
Handle channel subscriptions for the registration token
source code
 
token_server_groups(server_id, tokens_obj)
Handle server group subscriptions for the registration token
source code
 
token_packages(server_id, tokens_obj) source code
 
deploy_configs_if_needed(server) source code
 
_get_token_config_channels(token_id) source code
 
_get_current_config_channels(server_id) source code
 
token_config_channels(server, tokens_obj) source code
 
server_used_token(server_id, token_id) source code
 
check_token_limits(server_id, tokens_obj)
check the token registration limits
source code
 
_check_token_limits(server_id, token_rec) source code
 
_fetch_token_from_cursor(cursor)
Fetches a token from a prepared and executed cursor Used by both fetch_token and fetch_org_token
source code
 
_categorize_token_entitlements(token_entitlements, entitlements_base, entitlements_extra)
Given a hash token_entitlements, splits the base ones and puts them in the entitlements_base hash, and the extras in entitlements_extra
source code
 
_validate_entitlements(token_string, rereg_ents, base_entitlements, extra_entitlements, remove_entitlements)
Perform various checks on the final list of entitlements accumulated after processing all activation keys.
source code
 
fetch_token(token_string)
Fetches a token from the database
source code
 
fetch_org_token(org_id) source code
 
disable_token(tokens_obj) source code
 
process_token(server, server_arch, tokens_obj, virt_type=None)
perform registration tasks for a server as indicated by a token
source code
 
history_report(history)
build a mildly html-ized version of the history as a report
source code
 
history_subreport(history, key, title, emptymsg) source code
Variables [hide private]
  VIRT_ENT_LABEL = 'virtualization_host'
hash(x)
  _query_token_server_groups = <spacewalk.server.rhnSQL.sql_base...
  _query_token_packages = <spacewalk.server.rhnSQL.sql_base.Stat...
  _query_token_packages_insert = <spacewalk.server.rhnSQL.sql_ba...
  _query_token_latest_revisions = <spacewalk.server.rhnSQL.sql_b...
  _query_add_revision_to_action = <spacewalk.server.rhnSQL.sql_b...
  _query_token_config_channels = <spacewalk.server.rhnSQL.sql_ba...
  _query_set_server_config_channels = <spacewalk.server.rhnSQL.s...
  _query_current_config_channels = <spacewalk.server.rhnSQL.sql_...
  _query_server_token_used = <spacewalk.server.rhnSQL.sql_base.S...
  _query_check_server_uses_token = <spacewalk.server.rhnSQL.sql_...
  _query_check_token_limits = <spacewalk.server.rhnSQL.sql_base....
  _query_token = <spacewalk.server.rhnSQL.sql_base.Statement ins...
  _query_org_default_token = <spacewalk.server.rhnSQL.sql_base.S...
  _query_disable_token = <spacewalk.server.rhnSQL.sql_base.State...
  __package__ = 'backend.server.rhnServer'
Function Details [hide private]

_validate_entitlements(token_string, rereg_ents, base_entitlements, extra_entitlements, remove_entitlements)

source code 

Perform various checks on the final list of entitlements accumulated after processing all activation keys.

rereg_ents passed in as a list of entitlement labels.

Extra/base entitlements passed in as a hash of tuples ('label', 'Friendly Name') mapping to None. (i.e. seems to be used as just a set)

Remove entitlements being maintained as just a list of labels.


Variables Details [hide private]

_query_token_server_groups

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289278\
4; statement=
    select rtg.server_group_id, sg.name
      from rhnRegTokenGroups rtg, rhnServerGroup sg
     where rtg.token_id = :token_id
       and sg.id = rtg.server_group_id

_query_token_packages

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289292\
8; statement=
    select pn.id as name_id, pa.id as arch_id, pn.name
    from rhnPackageName pn, rhnRegTokenPackages rtp
        left outer join rhnPackageArch pa on rtp.arch_id = pa.id
    where rtp.token_id = :token_id
        and rtp.name_id = pn.id
    order by upper(pn.name)
...

_query_token_packages_insert

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289300\
0; statement=
    insert into rhnActionPackage (id, action_id, name_id, parameter)
    values (sequence_nextval('rhn_act_p_id_seq'), :action_id, :name_id\
, 'upgrade')

_query_token_latest_revisions

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289307\
2; statement=
    select cf.latest_config_revision_id revision_id,
           cfn.path
      from rhnConfigFileName cfn,
           rhnConfigFile cf,
           rhnConfigChannelType cct,
           rhnConfigChannel cc,
...

_query_add_revision_to_action

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289314\
4; statement=
    insert into rhnActionConfigRevision (id, action_id, server_id, con\
fig_revision_id)
    values (sequence_nextval('rhn_actioncr_id_seq'), :action_id, :serv\
er_id, :config_revision_id)

_query_token_config_channels

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289321\
6; statement=
    select rtcc.config_channel_id,
           rtcc.position, cc.name
      from rhnConfigChannel cc,
           rhnRegTokenConfigChannels rtcc
     where rtcc.token_id = :token_id
       and rtcc.config_channel_id = cc.id
...

_query_set_server_config_channels

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289328\
8; statement=
    insert into rhnServerConfigChannel (server_id, config_channel_id, \
position)
    values (:server_id, :config_channel_id, :position)

_query_current_config_channels

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289336\
0; statement=
    select config_channel_id
      from rhnServerConfigChannel
       where server_id = :server_id
           and position is not null

_query_server_token_used

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289343\
2; statement=
    insert into rhnServerTokenRegs (server_id, token_id)
    values (:server_id, :token_id)

_query_check_server_uses_token

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289350\
4; statement=
    select 1 from rhnServerTokenRegs
    where server_id = :server_id
    and token_id = :token_id

_query_check_token_limits

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289357\
6; statement=
    select
       rt.usage_limit max_nr,
       ( select count(server_id) from rhnServerTokenRegs
         where token_id = :token_id ) curr_nr
    from rhnRegToken rt
    where rt.id = :token_id
...

_query_token

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289364\
8; statement=
    select rt.id as token_id,
           sgt.label as token_type,
           sgt.name as token_desc,
           sgt.is_base,
           ak.token,
           rt.user_id,
...

_query_org_default_token

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289372\
0; statement=
    select rt.id as token_id,
           sgt.label as token_type,
           sgt.name as token_desc,
           sgt.is_base,
           ak.token,
           rt.user_id,
...

_query_disable_token

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081289379\
2; statement=
    update rhnRegToken
       set disabled = 1
     where id = :token_id