def readConfigVars(self): """ Returns content of my.cnf @return ConfigParser config parser instance """ if self.configVars: return self.configVars cnfContent = self.getConfigContent() if cnfContent: self.configVars = iniparser.getInivars(cnfContent) return self.configVars
def __parse_db2cli_ini(self, content): """ :param content: ini file content :type content: str or unicode :return: hostname, port, database :rtype: str, int, str """ if content: lines = ifilter(None, imap(methodcaller('strip'), content.splitlines())) config = iniparser.getInivars(lines) items = dict(config.items(self._name)) if items and items.get("dbalias") is None: return items.get("hostname"), items.get("port"), items.get("database")
def __parse_db2cli_ini(self, content): """ :param content: ini file content :type content: str or unicode :return: hostname, port, database :rtype: str, int, str """ if content: lines = ifilter(None, imap(methodcaller('strip'), content.splitlines())) config = iniparser.getInivars(lines) items = dict(config.items(self._name)) if items and items.get("dbalias") is None: return items.get("hostname"), items.get("port"), items.get( "database")