Changeset 3358

Show
Ignore:
Timestamp:
01/11/10 22:15:05 (10 years ago)
Author:
imcheng
Message:

changed exception handling for seattleuninstaller.py for nokia

Location:
seattle/trunk/dist
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/dist/seattleinstaller.py

    r3357 r3358  
    20032003    return 
    20042004 
     2005 
     2006  # Derek Cheng: if the user is running a Nokia N800 tablet, we require them 
     2007  # to be on root first in order to have files created in the /etc/init.d and 
     2008  # /etc/rc2.d directories.  
     2009  if platform.node().startswith('Nokia-N'): 
     2010    _output('Seattle is being installed on a Nokia N800/900 Internet Tablet.') 
     2011    # if the current user name is not 'root' 
     2012    if pwd.getpwuid(os.getuid())[0] != 'root': 
     2013      _output('Please run the installer as root. This can be done by ' \ 
     2014                + 'installing/using the rootsh or openssh package.') 
     2015      return 
     2016 
     2017 
    20052018  # Pre-install: process the passed-in arguments, and set up the configuration 
    20062019  #   dictionary. 
     
    20202033    return 
    20212034 
    2022  
    2023   # Derek Cheng: if the user is running a Nokia N800 tablet, we require them 
    2024   # to be on root first in order to have files created in the /etc/init.d and 
    2025   # /etc/rc2.d directories.  
    2026   if platform.node().startswith('Nokia-N'): 
    2027     _output('Seattle is being installed on a Nokia N800/900 Internet Tablet.') 
    2028     # if the current user name is not 'root' 
    2029     if pwd.getpwuid(os.getuid())[0] != 'root': 
    2030       _output('Please run the installer as root. This can be done by ' \ 
    2031                 + 'installing/using the rootsh or openssh package.') 
    2032       return 
    20332035 
    20342036 
  • seattle/trunk/dist/seattleuninstaller.py

    r3357 r3358  
    391391    os.remove(startup_script_path) 
    392392  # Cannot remove the startup script due to some reason. 
    393   except OSError as (error_number, error_desc): 
     393  except OSError, e: 
    394394    # The startup script does not exist - that is fine, we will continue  
    395395    # and try to remove the symlink. 
    396     if error_number == errno.ENOENT: 
     396    if e.errno == errno.ENOENT: 
    397397      pass 
    398398    else: 
     
    408408    os.remove(symlink_path) 
    409409  # Cannot remove the symlink due to some reason. 
    410   except OSError as (error_number, error_desc): 
     410  except OSError, e: 
    411411    # The symlink does not exist - that is fine. 
    412     if error_number == errno.ENOENT: 
     412    if e.errno == errno.ENOENT: 
    413413      pass 
    414414    else: 
     
    587587def main(): 
    588588 
     589  # Derek Cheng: If the user is running the uninstaller on the Nokia N800, we  
     590  # require them to be on root to remove some files in /etc/init.d and  
     591  # /etc/rc2.d directories. This needs to preceed servicelogger.init, since 
     592  # only root has permission to installInfo.  
     593  if platform.node().startswith('Nokia-N'): 
     594    # Check to see if the current user is root. 
     595    if pwd.getpwuid(os.getuid())[0] != 'root': 
     596      _output('Please run the uninstaller as root. This can be done by ' \ 
     597                + 'installing/using the rootsh or openssh package.') 
     598      return 
     599 
    589600  # Begin pre-uninstall process. 
    590601 
     
    605616    return 
    606617 
    607   # Derek Cheng: If the user is running the uninstaller on the Nokia N800, we  
    608   # require them to be on root to remove some files in /etc/init.d and  
    609   # /etc/rc2.d directories. 
    610   if platform.node().startswith('Nokia-N'): 
    611     # Check to see if the current user is root. 
    612     if pwd.getpwuid(os.getuid())[0] != 'root': 
    613       _output('Please run the uninstaller as root. This can be done by ' \ 
    614                 + 'installing/using the rootsh or openssh package.') 
    615       return 
    616618 
    617619  # Begin uninstall process.