Home | Trees | Indices | Help |
|
---|
|
1 # 2 # Copyright (c) 2010 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 Pulp Client 18 """ 19 20 import os 2123 """ 24 Client identity 25 @ivar uuid: The client id. 26 @type uuid: str 27 """ 28 29 PATH = '/etc/pulp/consumer' 307132 """ 33 @ivar value: The client id. 34 @type value: str 35 """ 36 self.uuid = None 37 if uuid: 38 self.uuid = uuid 39 else: 40 self.read()4143 """ 44 Read identity from file. 45 """ 46 if not self.exists(): 47 return 48 f = open(self.PATH) 49 try: 50 self.uuid = f.read().strip() 51 return self 52 finally: 53 f.close()5456 """ 57 Write identity to file. 58 """ 59 f = open(self.PATH, 'w') 60 try: 61 f.write(self.uuid) 62 return self 63 finally: 64 f.close()65 68
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Sep 7 12:30:34 2010 | http://epydoc.sourceforge.net |