Package backend :: Package server :: Package action :: Module errata
[hide private]
[frames] | no frames]

Source Code for Module backend.server.action.errata

 1  # 
 2  # Copyright (c) 2008--2016 Red Hat, Inc. 
 3  # 
 4  # This software is licensed to you under the GNU General Public License, 
 5  # version 2 (GPLv2). There is NO WARRANTY for this software, express or 
 6  # implied, including the implied warranties of MERCHANTABILITY or FITNESS 
 7  # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 
 8  # along with this software; if not, see 
 9  # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 
10  # 
11  # Red Hat trademarks are not licensed under GPLv2. No permission is 
12  # granted to use or replicate Red Hat trademarks that are incorporated 
13  # in this software or its documentation. 
14  # 
15  # 
16   
17  from spacewalk.common.rhnLog import log_debug 
18  from spacewalk.server import rhnSQL 
19  from spacewalk.server.rhnLib import InvalidAction 
20   
21  # the "exposed" functions 
22  __rhnexport__ = ['update'] 
23   
24  # returns a list of errata scheduled for this action 
25   
26   
27 -def update(serverId, actionId, dry_run=0):
28 log_debug(3) 29 statement = """ 30 select errata_id 31 from rhnActionErrataUpdate 32 where action_id = :action_id""" 33 h = rhnSQL.prepare(statement) 34 h.execute(action_id=actionId) 35 ret = h.fetchall_dict() 36 if not ret: 37 # No errata for this action 38 raise InvalidAction("errata.update: Unknown action id " 39 "%s for server %s" % (actionId, serverId)) 40 41 return [x['errata_id'] for x in ret]
42