Browse Source

Updated to install redis when ee site create --redis is called

release/v3.3.0
gau1991 10 years ago
parent
commit
46cf43e1db
  1. 20
      ee/cli/plugins/site.py
  2. 4
      ee/cli/plugins/site_functions.py
  3. 2
      ee/cli/plugins/stack.py

20
ee/cli/plugins/site.py

@ -515,20 +515,20 @@ class EESiteCreateController(CementBaseController):
data['pagespeed'] = False
pagespeed = 0
if (cache == 'redis' not self.app.pargs.experimental) and :
if (cache == 'redis' and (not self.app.pargs.experimental)):
Log.info(self, "Redis is experimental feature and it may not"
"work with all CSS/JS/Cache of your site.\nYou can "
"disable it by passing --redis=off later.\nDo you wish"
"disable it by changing cache later.\nDo you wish"
" to enable Redis now for {0}?".format(ee_domain))
# Check prompt
check_prompt = input("Type \"y\" to continue [n]:")
if check_prompt != "Y" and check_prompt != "y":
Log.info(self, "Not using Redis for site.")
cache = 'basic'
data['redis'] = False
data['basic'] = True
self.app.pargs.redis = False
check_prompt = input("Type \"y\" to continue [n]:")
if check_prompt != "Y" and check_prompt != "y":
Log.info(self, "Not using Redis for site.")
cache = 'basic'
data['redis'] = False
data['basic'] = True
self.app.pargs.redis = False
# self.app.args.print_help()
# if not data:
@ -1223,7 +1223,7 @@ class EESiteUpdateController(CementBaseController):
" `tail /var/log/ee/ee.log` & Try Again!!!")
return 1
if oldcachetype == 'redis' and not data['rediss']:
if oldcachetype == 'redis' and not data['redis']:
try:
uninstallwp_plugin(self, 'redis-cache', data)
except SiteError as e:

4
ee/cli/plugins/site_functions.py

@ -603,6 +603,10 @@ def site_package_check(self, stype):
"wp-cli-{0}.phar"
.format(EEVariables.ee_wp_cli),
"/usr/bin/wp", "WP-CLI"]]
if self.app.pargs.redis:
Log.debug(self, "Setting apt_packages variable for redis")
if not EEAptGet.is_installed(self, 'redis-server'):
apt_packages = apt_packages + EEVariables.ee_redis
if self.app.pargs.hhvm:
if platform.architecture()[0] is '32bit':

2
ee/cli/plugins/stack.py

@ -529,7 +529,7 @@ class EEStackController(CementBaseController):
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/redis.conf')
ee_nginx = open('/etc/nginx/common/php-hhvm.conf',
ee_nginx = open('/etc/nginx/common/redis.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'redis.mustache',
out=ee_nginx)

Loading…
Cancel
Save