@@ -40,23 +40,35 @@ class ClusterError(pg_exc.Error):
4040 code = '-C000'
4141 source = 'CLUSTER'
4242class ClusterInitializationError (ClusterError ):
43- "General cluster initialization failure"
43+ """
44+ General cluster initialization failure.
45+ """
4446 code = '-Cini'
4547class InitDBError (ClusterInitializationError ):
46- "A non-zero result was returned by the initdb command"
48+ """
49+ A non-zero result was returned by the initdb command.
50+ """
4751 code = '-Cidb'
4852class ClusterStartupError (ClusterError ):
49- "Cluster startup failed"
53+ """
54+ Cluster startup failed.
55+ """
5056 code = '-Cbot'
5157class ClusterNotRunningError (ClusterError ):
52- "Cluster is not running"
58+ """
59+ Cluster is not running.
60+ """
5361 code = '-Cdwn'
5462class ClusterTimeoutError (ClusterError ):
55- "Cluster operation timed out"
63+ """
64+ Cluster operation timed out.
65+ """
5666 code = '-Cout'
5767
5868class ClusterWarning (pg_exc .Warning ):
59- "Warning issued by cluster operations"
69+ """
70+ Warning issued by cluster operations.
71+ """
6072 code = '-Cwrn'
6173 source = 'CLUSTER'
6274
@@ -154,10 +166,7 @@ def hba_file(self, join = os.path.join):
154166 join (self .data_directory , self .DEFAULT_HBA_FILENAME )
155167 )
156168
157- def __init__ (self ,
158- installation ,
159- data_directory ,
160- ):
169+ def __init__ (self , installation , data_directory ):
161170 self .installation = installation
162171 self .data_directory = os .path .abspath (data_directory )
163172 self .pgsql_dot_conf = os .path .join (
@@ -190,11 +199,7 @@ def __exit__(self, typ, val, tb):
190199 self .stop ()
191200 self .wait_until_stopped ()
192201
193- def init (self ,
194- password = None ,
195- timeout = None ,
196- ** kw
197- ):
202+ def init (self , password = None , timeout = None , ** kw ):
198203 """
199204 Create the cluster at the given `data_directory` using the
200205 provided keyword parameters as options to the command.
@@ -323,10 +328,7 @@ def drop(self):
323328 os .rmdir (os .path .join (root , name ))
324329 os .rmdir (self .data_directory )
325330
326- def start (self ,
327- logfile = None ,
328- settings = None
329- ):
331+ def start (self , logfile = None , settings = None ):
330332 """
331333 Start the cluster.
332334 """
@@ -562,10 +564,7 @@ def ready_for_connections(self):
562564 # credentials... strange, but true..
563565 return e if e is not None else True
564566
565- def wait_until_started (self ,
566- timeout = 10 ,
567- delay = 0.05 ,
568- ):
567+ def wait_until_started (self , timeout = 10 , delay = 0.05 ):
569568 """
570569 After the `start` method is used, this can be ran in order to block
571570 until the cluster is ready for use.
@@ -614,10 +613,7 @@ def wait_until_started(self,
614613 raise e
615614 time .sleep (delay )
616615
617- def wait_until_stopped (self ,
618- timeout = 10 ,
619- delay = 0.05
620- ):
616+ def wait_until_stopped (self , timeout = 10 , delay = 0.05 ):
621617 """
622618 After the `stop` method is used, this can be ran in order to block until
623619 the cluster is shutdown.
0 commit comments