MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / get_options

Method get_options

class/databaseModel/pgsqlModel.py:252–264  ·  view source on GitHub ↗
(self, get)

Source from the content-addressed store, hash-verified

250
251 # 获取配置项
252 def get_options(self, get):
253 data = {}
254 options = ['port', 'listen_addresses']
255 if not self.__soft_path: self.__soft_path = '{}/pgsql'.format(public.get_setup_path())
256 conf = public.readFile('{}/data/postgresql.conf'.format(self.__soft_path))
257 for opt in options:
258 tmp = re.findall("\s+" + opt + "\s*=\s*(.+)#", conf)
259 if not tmp: continue
260 data[opt] = tmp[0].strip()
261 if opt == 'listen_addresses':
262 data[opt] = data[opt].replace('\'', '')
263 data['password'] = self.get_root_pwd(None)['msg']
264 return data
265
266 def get_list(self,args):
267 """

Callers 2

redis_backup_databaseMethod · 0.45
_baseMethod · 0.45

Calls 4

get_root_pwdMethod · 0.95
readFileMethod · 0.80
formatMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected