Changeset - 20b3ba3f4e6e
[Not reviewed]
0 1 0
Lance Edgar (lance) - 7 years ago 2018-01-22 16:28:55
lance@edbob.org
Accept 'user' kwarg when cloning MySQL database via fabric
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rattail/fablib/mysql.py
Show inline comments
 
@@ -178,7 +178,7 @@ def restore_db(name, source=None, user=None):
 
    sudo('rm {}.sql'.format(name))
 

	
 

	
 
def clone_db(name, download, force=False):
 
def clone_db(name, download, user='rattail', force=False):
 
    """
 
    Clone a MySQL database from a (presumably live) server
 

	
 
@@ -196,7 +196,7 @@ def clone_db(name, download, force=False):
 
    create_db(name, checkfirst=False)
 

	
 
    # obtain database dump from live server
 
    download()
 
    download('{}.sql.gz'.format(name), user=user)
 

	
 
    # upload database dump to target server
 
    put('{}.sql.gz'.format(name))
0 comments (0 inline, 0 general)