Ticket #1327: sugar-1327.2.patch

File sugar-1327.2.patch, 1.1 KB (added by alsroot, 12 years ago)
  • src/sugar/profile.py

    From feef38f5167d3d2d88bafcff38078f5394200e9b Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Tue, 15 Sep 2009 17:15:07 +0000
    Subject: Error while initiating .sugar environment #1327
    
    ---
     src/sugar/profile.py |   10 ++++++++++
     1 files changed, 10 insertions(+), 0 deletions(-)
    
    diff --git a/src/sugar/profile.py b/src/sugar/profile.py
    index e5f5dc7..4eb53b0 100644
    a b class Profile(object): 
    6565
    6666    def _load_pubkey(self):
    6767        key_path = os.path.join(env.get_profile_path(), 'owner.key.pub')
     68
     69        if not os.path.exists(key_path):
     70            logging.info('Cannot find public key')
     71            return None
     72
    6873        try:
    6974            f = open(key_path, "r")
    7075            lines = f.readlines()
    class Profile(object): 
    9196
    9297    def _hash_private_key(self):
    9398        key_path = os.path.join(env.get_profile_path(), 'owner.key')
     99
     100        if not os.path.exists(key_path):
     101            logging.info('Cannot find private key')
     102            return None
     103
    94104        try:
    95105            f = open(key_path, "r")
    96106            lines = f.readlines()