2018-11-05 08:47:35 +01:00
|
|
|
Index: patroni/features/environment.py
|
|
|
|
===================================================================
|
|
|
|
--- patroni.orig/features/environment.py
|
|
|
|
+++ patroni/features/environment.py
|
2019-02-08 15:45:23 +01:00
|
|
|
@@ -611,6 +611,8 @@ class PatroniPoolController(object):
|
|
|
|
feature_dir = os.path.join(self.patroni_path, 'features/output', feature_name.replace(' ', '_'))
|
|
|
|
if os.path.exists(feature_dir):
|
|
|
|
shutil.rmtree(feature_dir)
|
|
|
|
+ if os.path.exists(feature_dir + '_failed'):
|
|
|
|
+ shutil.rmtree(feature_dir + '_failed')
|
|
|
|
os.makedirs(feature_dir)
|
|
|
|
self._output_dir = feature_dir
|
|
|
|
|
2019-01-15 19:12:12 +01:00
|
|
|
@@ -823,3 +823,5 @@ def after_feature(context, feature):
|
2018-09-25 15:44:49 +02:00
|
|
|
context.pctl.stop_all()
|
|
|
|
shutil.rmtree(os.path.join(context.pctl.patroni_path, 'data'))
|
|
|
|
context.dcs_ctl.cleanup_service_tree()
|
|
|
|
+ if feature.status == 'failed':
|
2019-02-08 15:45:23 +01:00
|
|
|
+ shutil.copytree(context.pctl.output_dir, context.pctl.output_dir + '_failed')
|