Changeset - b9c8a8d10470
[Not reviewed]
0 1 0
Lance Edgar - 5 years ago 2019-09-13 13:24:18
lance@edbob.org
Add `postgresql.restart()` convenience function
1 file changed with 8 insertions and 3 deletions:
0 comments (0 inline, 0 general) First comment
rattail_fabric2/postgresql.py
Show inline comments
 
@@ -2,7 +2,7 @@
 
################################################################################
 
#
 
#  Rattail -- Retail Software Framework
 
#  Copyright © 2010-2018 Lance Edgar
 
#  Copyright © 2010-2019 Lance Edgar
 
#
 
#  This file is part of Rattail.
 
#
 
@@ -24,8 +24,6 @@
 
Fabric Library for PostgreSQL
 
"""
 

	
 
from __future__ import unicode_literals, absolute_import
 

	
 
import os
 

	
 
from rattail_fabric2 import apt
 
@@ -38,6 +36,13 @@ def install(c):
 
    apt.install(c, 'postgresql')
 

	
 

	
 
def restart(c):
 
    """
 
    Restart the PostgreSQL database service
 
    """
 
    c.sudo('systemctl restart postgresql.service')
 

	
 

	
 
def sql(c, sql, database='', port=None):
 
    """
 
    Execute some SQL as the 'postgres' user.
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now