def removeNuwaAddress(self):
     serviceNuwaRootPath = self.ha2Configuration.getServiceNuwaRootAddress()
     nuwaConsole = NuwaConsoleWrapper(self.configuration.nuwaConsoleBin)
     timeout = self.configuration.commandTimeout
     if not nuwaConsole.removeIfExists(serviceNuwaRootPath, timeout):
         self.logger.error("remove nuwa address fail: [%s]" % serviceNuwaRootPath)
         return False
     return True
    def stopService(self):
        self.logger.info('stop service: [%s]' % self.configPath)
        timeout = self.configuration.stopServiceTimeout
        if not self.ha2Tool.stopService(self.serviceName,timeout):
            return False

        self.restarted = False
        self.waitForServiceUnload()

        #remove nuwa path for this service

        serviceNuwaRootPath = self.ha2Configuration.getServiceNuwaRootAddress()
        self.logger.info('remove nuwa dir for [%s]' % serviceNuwaRootPath)
        nuwaConsole = NuwaConsoleWrapper(self.configuration.nuwaConsoleBin)
        timeout = self.configuration.commandTimeout
        nuwaConsole.removeIfExists(serviceNuwaRootPath, timeout)
        return True
 def getQrsAddressList(self, configPath):
     ha2Configuration = Ha2Configuration(configPath)
     qrsRoot = ha2Configuration.getQrsAddress()
     nuwaConsole = NuwaConsoleWrapper(self.configuration.nuwaConsoleBin)
     cmdTimeout = self.configuration.commandTimeout
     return nuwaConsole.listDirectory(qrsRoot, cmdTimeout)