File tree 2 files changed +10
-6
lines changed
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):
628
628
else :
629
629
_params = ["-D" , self .data_dir ]
630
630
631
- lines = _execute_utility ("pg_controldata" , _params , self .utils_logname )
631
+ data = _execute_utility ("pg_controldata" , _params , self .utils_logname )
632
632
633
- out_data = {}
633
+ out_dict = {}
634
634
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 ()
638
638
639
- return out_data
639
+ return out_dict
640
640
641
641
def start (self , params = []):
642
642
"""
Original file line number Diff line number Diff line change @@ -155,7 +155,11 @@ def test_control_data(self):
155
155
try :
156
156
node .init ()
157
157
data = node .get_control_data ()
158
+
159
+ # check returned dict
158
160
self .assertIsNotNone (data )
161
+ self .assertTrue (any ('pg_control' in s for s in data .keys ()))
162
+
159
163
except ExecUtilException as e :
160
164
print (e .message )
161
165
got_exception = True
You can’t perform that action at this time.
0 commit comments