Script rhncfg_client_py
[hide private]
[frames] | no frames]

Source Code for Script script-rhncfg_client_py

 1  #!/usr/bin/python 
 2  # 
 3  # Copyright (c) 2008--2012 Red Hat, Inc. 
 4  # 
 5  # This software is licensed to you under the GNU General Public License, 
 6  # version 2 (GPLv2). There is NO WARRANTY for this software, express or 
 7  # implied, including the implied warranties of MERCHANTABILITY or FITNESS 
 8  # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 
 9  # along with this software; if not, see 
10  # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 
11  # 
12  # Red Hat trademarks are not licensed under GPLv2. No permission is 
13  # granted to use or replicate Red Hat trademarks that are incorporated 
14  # in this software or its documentation. 
15  # 
16   
17  import sys, os 
18   
19  from config_common.rhn_main import BaseMain 
20   
21 -class Main(BaseMain):
22 modes = ['diff', 'get', 'list', 'elist', 'channels', 'verify'] 23 repository_class_name = 'ClientRepository' 24 plugins_dir = 'config_client' 25 config_section = 'rhncfg-client' 26 mode_prefix = 'rhncfgcli'
27 28 29 if __name__ == '__main__': 30 # quick check to see if you are a super-user. 31 if os.getuid() != 0: 32 sys.stderr.write("ERROR: must be root to execute!" + "\n") 33 sys.exit(1) 34 try: 35 sys.exit(Main().main() or 0) 36 except KeyboardInterrupt: 37 sys.stderr.write("user interrupted\n") 38 sys.exit(0) 39