Skip to content

Commit ffffba7

Browse files
author
James William Pye
committed
Add ssl property to Installation for identifying SSL support.
It provides a useful abstraction for ``'with_openssl' in configure_options``. ie, if the configure option ever changes, it's best for the abstraction to exist on the installation object rather than a user's usage.
1 parent 14365bc commit ffffba7

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

postgresql/api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,13 @@ def type(self):
13841384
returned by pg_config.
13851385
"""
13861386

1387+
@propertydoc
1388+
@abstractproperty
1389+
def ssl(self) -> bool:
1390+
"""
1391+
Whether the installation supports SSL.
1392+
"""
1393+
13871394
class Cluster(InterfaceElement):
13881395
"""
13891396
Interface to a PostgreSQL cluster--a data directory. An implementation of

postgresql/installation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ def __dir__(self):
240240
dir(super()),
241241
)))
242242

243+
@property
244+
def ssl(self):
245+
return 'with_openssl' in self.configure_options
246+
243247
def __getattr__(self, attname):
244248
try:
245249
return getattr(super(), attname)

0 commit comments

Comments
 (0)