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

Source Code for Module backend.server.rhnMapping

 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  from spacewalk.server import rhnSQL 
17   
18  # checks if an arch is for real 
19   
20   
21 -def check_package_arch(name):
22 name = str(name) 23 if name is None or len(name) == 0: 24 return None 25 h = rhnSQL.prepare("select id from rhnPackageArch where label = :label") 26 h.execute(label=name) 27 ret = h.fetchone_dict() 28 if not ret: 29 return None 30 return name
31 32 if __name__ == '__main__': 33 """Test code. 34 """ 35 rhnSQL.initDB() 36 print(check_package_arch('i386')) 37