Skip to content

Commit d153ecb

Browse files
committed
clone_wp_site.py: Fix error when cloning locally, fix #6
The local and remote sql files now have unique names. This prevents the remote sql file from being unintentionally deleted before it is imported, and allows both local and remote clones to work without introducing conditional logic.
1 parent 13642f1 commit d153ecb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/clone_wp_site.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def main(args):
6969
sqlpasswd_filepath_remote = f'/home/{DST_OSUSER_NAME}/{DST_APP_NAME}.sqlpasswd'
7070

7171
sql_filepath_local = os.path.expanduser(f'~/{DST_APP_NAME}.sql')
72-
sql_filepath_remote = f'/home/{DST_OSUSER_NAME}/{DST_APP_NAME}.sql'
72+
sql_filepath_remote = f'/home/{DST_OSUSER_NAME}/{DST_APP_NAME}_remote.sql'
7373

7474
# Retrieve web_server and primary IP entries for later use
7575
log.info(f'Retrieving webserver information for {DST_WEB_SERVER_HOSTNAME}')
@@ -149,7 +149,7 @@ def main(args):
149149
sshrunner.run_passbased_rsync(f'{src_app_path}/', f'{userhost}:{dst_app_path}/')
150150

151151
log.info(f'Copying database content')
152-
sshrunner.run_passbased_scp(sql_filepath_local, f'{userhost}:')
152+
sshrunner.run_passbased_scp(sql_filepath_local, f'{userhost}:{sql_filepath_remote}')
153153
os.remove(sql_filepath_local)
154154

155155
log.info(f'Importing database')

0 commit comments

Comments
 (0)