Package backend :: Package server :: Package handlers :: Package xmlrpc :: Module queue :: Class Queue
[hide private]
[frames] | no frames]

Class Queue

source code


XMLRPC queue functions that we will provide for the outside world.

Instance Methods [hide private]
 
__init__(self)
Add a list of functions we are willing to server out.
source code
 
__getV1(self, action)
Fetches old queued actions for the client version 1.
source code
 
__getV2(self, action, dry_run=0)
Fetches queued actions for the clients version 2+.
source code
 
__update_status(self, status)
Update the runnng kernel and the last boot values for this server from the status dictionary passed on queue checkin.
source code
 
__set_reboot_action_to_succcess(self) source code
 
__should_snapshot(self) source code
 
_invalidate_child_actions(self, action_id) source code
 
_invalidate_failed_prereq_actions(self) source code
 
_future_actions_enabled(self)
Returns true if staging content is enabled for this system
source code
 
get_future_actions(self, system_id, time_window)
return actions which are scheduled within next /time_window/ hours
source code
 
get(self, system_id, version=1, status={}) source code
 
submit(self, system_id, action_id, result, message='', data={})
Submit the results of a queue run.
source code
 
status_for_action_type_code(self, action_type, rcode)
Convert whatever the client sends as a result code into a status in the database format This is more complicated, since some of the client's result codes have to be marked as successes.
source code
 
process_extra_data(self, server_id, action_id, data={}, action_type=None) source code
 
length(self, system_id)
Return the queue length for a certain server.
source code
 
__reboot_in_progress(self)
check for a reboot action for this server in status Picked Up
source code
 
__update_action(self, action_id, status, resultCode=None, message='')
Update the status of an action.
source code
 
__errataUpdate(self, actionId)
Old client errata retrieval.
source code
 
__packageUpdate(self, actionId)
Old client package retrieval.
source code

Inherited from spacewalk.server.rhnHandler.rhnHandler: auth_system

Inherited from spacewalk.common.RPC_Base.RPC_Base: get_function

Class Variables [hide private]
  _query_future_enabled = <spacewalk.server.rhnSQL.sql_base.Stat...
  _query_queue_future = <spacewalk.server.rhnSQL.sql_base.Statem...
  _query_queue_get = <spacewalk.server.rhnSQL.sql_base.Statement...
Method Details [hide private]

__init__(self)
(Constructor)

source code 

Add a list of functions we are willing to server out.

Overrides: spacewalk.common.RPC_Base.RPC_Base.__init__

__update_status(self, status)

source code 
Update the runnng kernel and the last boot values for this
server from the status dictionary passed on queue checkin.

Record last running kernel and uptime.  Only update
last_boot if it has changed by more than five seconds. We
don't know the timezone the server is in. or even if its
clock is right, but we do know it can properly track seconds
 since it rebooted, and use our own clocks to keep proper
track of the actual time.

submit(self, system_id, action_id, result, message='', data={})

source code 
Submit the results of a queue run.
Maps old and new rhn_check behavior to new database status codes

The new API uses 4 slightly different status codes than the
old client does.  This function will "hopefully" sensibly
map them.  Old methodology:
   -rhn_check retrieves an action from the top of the action queue.
   -It attempts to execute the desired action and returns either
       (a) 0   -- presumed successful.
       (b) rhnFault object -- presumed failed
       (c) some other non-fault object -- *assumed* successful.
   -Regardless of result code, action is marked as "executed"

We try to make a smarter status selection (i.e. failed||completed).

For reference:
New DB status codes:      Old DB status codes:
      0: Queued               0: queued
      1: Picked Up            1: picked up
      2: Completed            2: executed
      3: Failed               3: completed


Class Variable Details [hide private]

_query_future_enabled

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081069323\
2; statement=
        select staging_content_enabled
          from rhnOrgConfiguration oc,
               rhnServer s
         where s.org_id = oc.org_id
           and s.id = :server_id
    

_query_queue_future

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081069431\
2; statement=
                    select sa.action_id id, a.version,
                           sa.remaining_tries, at.label as method,
                           at.unlocked_only,
                           a.prerequisite
                      from rhnServerAction sa,
                           rhnAction a,
...

_query_queue_get

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081069416\
8; statement=
                    select sa.action_id id, a.version,
                           sa.remaining_tries, at.label as method,
                           at.unlocked_only,
                           a.prerequisite
                      from rhnServerAction sa,
                           rhnAction a,
...