From 4e6418d1aecd5c0daa68aec70f93d726bad89391 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Wed, 19 Aug 2015 20:46:37 +0530 Subject: [PATCH] add return value --- ee/cli/plugins/site.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 703af9e4..d2c6010a 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -1306,7 +1306,20 @@ class EESiteUpdateController(CementBaseController): if oldcachetype != 'wpredis' and data['wpredis']: try: - installwp_plugin(self, 'redis-cache', data) + if installwp_plugin(self, 'redis-cache', data): + try: + wpconfig = open("{0}/wp-config.php".format(ee_site_webroot), + encoding='utf-8', mode='a') + wpconfig.write("\n\ndefine( \'WP_CACHE_KEY_SALT\', \'{0}:\' );" + .format(ee_domain)) + wpconfig.close() + except IOError as e: + Log.debug(self, str(e)) + Log.debug(self, "Editing wp-config.php failed.") + Log.info(self, Log.FAIL + "Editing wp-config failed. " + "Could not append:" + " define( 'WP_CACHE_KEY_SALT', '{sitename}:' );") + except SiteError as e: Log.debug(self, str(e)) Log.info(self, Log.FAIL + "Update site failed."