File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -628,15 +628,15 @@ def get_control_data(self):
628628 else :
629629 _params = ["-D" , self .data_dir ]
630630
631- lines = _execute_utility ("pg_controldata" , _params , self .utils_logname )
631+ data = _execute_utility ("pg_controldata" , _params , self .utils_logname )
632632
633- out_data = {}
633+ out_dict = {}
634634
635- for line in lines :
636- key , value = line .partition (':' )[:: 2 ]
637- out_data [key .strip ()] = value .strip ()
635+ for line in data . splitlines () :
636+ key , _ , value = line .partition (':' )
637+ out_dict [key .strip ()] = value .strip ()
638638
639- return out_data
639+ return out_dict
640640
641641 def start (self , params = []):
642642 """
Original file line number Diff line number Diff line change @@ -155,7 +155,11 @@ def test_control_data(self):
155155 try :
156156 node .init ()
157157 data = node .get_control_data ()
158+
159+ # check returned dict
158160 self .assertIsNotNone (data )
161+ self .assertTrue (any ('pg_control' in s for s in data .keys ()))
162+
159163 except ExecUtilException as e :
160164 print (e .message )
161165 got_exception = True
You can’t perform that action at this time.
0 commit comments