Changeset 10473

Show
Ignore:
Timestamp:
10/25/10 15:03:46 (3 years ago)
Author:
Snyder.Jason
Message:

added methods to check and see if the naming service is running and start it if necessary

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/trunk/tools/wavedash/src/NodeBooterUtils.py

    r10448 r10473  
    2222import time 
    2323import ConfigParser 
     24import wx 
    2425 
    2526DEFAULT_DOMAIN_MANAGER = 'dom/domain/DomainManager.dmd.xml' 
     
    5051        time.sleep(2) 
    5152        return nodeBooterProcess 
     53     
     54    def namingServiceIsRunning(self): 
     55        namecltResult = os.popen('nameclt list').read() 
     56        if namecltResult.startswith('DomainName'): 
     57            return True 
     58        return False; 
     59     
     60    def startNamingService(self): 
     61        nsCommand = self.controller.getOSSIEProperty('ossie', 'naming.service.start.command') 
     62        if not nsCommand == None: 
     63            if nsCommand.startswith('sudo'): 
     64                dialog = wx.TextEntryDialog(None, 'Please enter your root password to restart the naming service:', 'Restart Naming Service', '', style = wx.TE_PASSWORD | wx.OK | wx.CANCEL) 
     65                if dialog.ShowModal() == wx.ID_OK: 
     66                    password = dialog.GetValue() 
     67                    command = 'echo ' + '\"' + password + '\"' + ' | sudo -kS ' + nsCommand[5:] 
     68                    subprocess.Popen(command, shell=True) 
     69                    time.sleep(2) 
     70            else: 
     71                subprocess.Popen(nsCommand, shell=True) 
     72        else: 
     73            #default case 
     74            nsCommand = 'sudo service omniorb4-nameserver restart' 
     75            dialog = wx.TextEntryDialog(None, 'Please enter your root password to restart the naming service:', 'Restart Naming Service', '', style = wx.TE_PASSWORD | wx.OK | wx.CANCEL) 
     76            if dialog.ShowModal() == wx.ID_OK: 
     77                password = dialog.GetValue() 
     78                command = 'echo ' + '\"' + password + '\"' + ' | sudo -kS ' + nsCommand[5:] 
     79                subprocess.Popen(command, shell=True) 
     80                time.sleep(2) 
    5281