Restart the node according to the schedule.

The scheduled restart data structures are now independent of those
used by the normal restarts. This would be fixed in subsequent
commits.
Add the behave tests, that cover the POST /restart (but not DELETE).
This commit is contained in:
Oleksii Kliukin
2016-06-23 10:43:54 +02:00
parent e5cf06101a
commit 29845dd383
6 changed files with 104 additions and 8 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ import json
import psycopg2
import unittest
import dateutil.parser
from mock import Mock, patch
from patroni.api import RestApiHandler, RestApiServer
from patroni.dcs import ClusterConfig, Member
@@ -66,7 +67,7 @@ class MockPatroni(object):
tags = {}
version = '0.00'
noloadbalance = Mock(return_value=False)
scheduled_restart = {'schedule': '2016-08-29 12:45TZ+1'}
scheduled_restart = {'schedule': dateutil.parser.parse('2016-08-29 12:45TZ+1')}
@staticmethod
def sighup_handler():