Browse Source

Merge branch 'python' of github.com:rtCamp/easyengine into python

bugfixes
shital.rtcamp 10 years ago
parent
commit
3e2562dc13
  1. 5
      .travis.yml
  2. 13
      ee/cli/plugins/debug.py
  3. 1
      ee/cli/plugins/site.py
  4. 3
      ee/cli/plugins/stack.py
  5. 2
      ee/cli/templates/fastcgi.mustache
  6. 32
      ee/core/aptget.py
  7. 2
      ee/core/variables.py

5
.travis.yml

@ -57,10 +57,11 @@ script:
- sudo ee site create site12.org --wpsubdomain --wpfc
- sudo ee site create site12.in --wpfc --wpsubdomain
- sudo ee site create site12.net --wpfc --wpsubdomain
- sudo ee site create site12.org --wpfc --wpsubdomain
- sudo ee debug
- sudo ee debug --stop
- sudo ee debug site12.net
- sudo ee debug site12.net --stop
- sudo ee site create 1.com --html
- sudo ee site create 2.com --php
- sudo ee site create 3.com --mysql
@ -81,7 +82,7 @@ script:
- sudo ee site update site9.com --wpsubdomain --w3tc
- sudo ee site update site9.com --wpsubdomain --wpsc
- sudo ee site delete site12.com --all --no-prompt
- sudo ee site delete site12.in --all --no-prompt
- sudo ee site delete site12.net --no-prompt
- sudo ee site delete site12.org --no-prompt

13
ee/cli/plugins/debug.py

@ -86,11 +86,12 @@ class EEDebugController(CementBaseController):
config_path = ("/etc/nginx/sites-available/{0}"
.format(self.app.pargs.site_name))
if os.path.isfile(config_path):
if not EEShellExec.cmd_exec("grep \"error.log debug\" {0}"
.format(config_path)):
if not EEShellExec.cmd_exec(self, "grep \"error.log debug\" "
"{0}".format(config_path)):
Log.info(self, "Starting NGINX debug connection for "
"{0}".format(self.app.pargs.site_name))
EEShellExec.cmd_exec("sed -i \"s/error.log;/error.log "
EEShellExec.cmd_exec(self, "sed -i \"s/error.log;/"
"error.log "
"debug;/\" {0}".format(config_path))
self.trigger_nginx = True
@ -109,11 +110,11 @@ class EEDebugController(CementBaseController):
config_path = ("/etc/nginx/sites-available/{0}"
.format(self.app.pargs.site_name))
if os.path.isfile(config_path):
if EEShellExec.cmd_exec("grep \"error.log debug\" {0}"
if EEShellExec.cmd_exec(self, "grep \"error.log debug\" {0}"
.format(config_path)):
Log.info(self, "Stoping NGINX debug connection for {0}"
.format(self.app.pargs.site_name))
EEShellExec.cmd_exec("sed -i \"s/error.log debug;/"
EEShellExec.cmd_exec(self, "sed -i \"s/error.log debug;/"
"error.log;/\" {0}"
.format(config_path))
self.trigger_nginx = True
@ -286,7 +287,7 @@ class EEDebugController(CementBaseController):
EEShellExec.cmd_exec(self, "sed -i \"/define(\'"
"WP_DEBUG_LOG\', true);/d\" {0}"
.format(wp_config))
EEShellExec.cmd_exec("sed -i \"/define(\'"
EEShellExec.cmd_exec(self, "sed -i \"/define(\'"
"SAVEQUERIES\', "
"true);/d\" {0}".format(wp_config))
else:

1
ee/cli/plugins/site.py

@ -836,7 +836,6 @@ class EESiteUpdateController(CementBaseController):
if oldsitetype == 'mysql':
config_file = (ee_site_webroot + '/backup/{0}/ee-config.php'
.format(EEVariables.ee_date))
print(config_file, 'DB_NAME')
data['ee_db_name'] = (EEFileUtils.grep(self, config_file,
'DB_NAME')
.split(',')[1]

3
ee/cli/plugins/stack.py

@ -682,7 +682,8 @@ class EEStackController(CementBaseController):
Log.debug(self, "Creating directory "
"/var/www/22222/htdocs/")
os.makedirs('/var/www/22222/htdocs/')
shutil.move('/tmp/ViMbAdmin-3.0.10/',
shutil.move('/tmp/ViMbAdmin-{0}/'
.format(EEVariables.ee_vimbadmin),
'/var/www/22222/htdocs/vimbadmin/')
# Donwload composer and install ViMbAdmin

2
ee/cli/templates/fastcgi.mustache

@ -2,7 +2,7 @@
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:50m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header updating http_500 http_503;
fastcgi_cache_valid any 1h;
fastcgi_cache_valid 200 301 302 404 1h;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SERVER_NAME $http_host;

32
ee/core/aptget.py

@ -151,6 +151,8 @@ class EEAptGet():
fprogress = apt.progress.text.AcquireProgress()
iprogress = apt.progress.base.InstallProgress()
onelevel = []
my_selected_packages = []
# Cache Initialization
if not cache:
@ -176,22 +178,11 @@ class EEAptGet():
# 2) We sequentially remove every package in list
# - via is_auto_installed we check if we can safely remove it
deplist = []
onelevel = __dependencies_loop(cache, deplist, pkg,
onelevel=True)
onelevel = onelevel + __dependencies_loop(cache, deplist, pkg,
onelevel=True)
# Mark for deletion the first package, to fire up
# auto_removable Purge?
for dep in onelevel:
my_selected_packages.append(dep.name)
try:
if purge:
dep.mark_delete(purge=True)
else:
dep.mark_delete(purge=False)
except SystemError as e:
Log.debug(self, "{0}".format(e))
Log.error(self, "Unable to purge depedencies.")
try:
if purge:
pkg.mark_delete(purge=True)
@ -199,7 +190,20 @@ class EEAptGet():
pkg.mark_delete(purge=False)
except SystemError as e:
Log.debug(self, "{0}".format(e))
Log.error(self, "Unable to purge packages.")
apt.ProblemResolver(cache).remove(pkg)
# print(pkg.inst_state)
# Log.error(self, "Unable to purge packages.")
for dep in onelevel:
my_selected_packages.append(dep.name)
try:
if purge:
dep.mark_delete(purge=True)
else:
dep.mark_delete(purge=False)
except SystemError as e:
Log.debug(self, "{0}".format(e))
Log.error(self, "Unable to purge depedencies.")
# Check if packages available for remove/update.
if cache.delete_count > 0:

2
ee/core/variables.py

@ -18,7 +18,7 @@ class EEVariables():
ee_wp_cli = "0.18.0"
ee_adminer = "4.1.0"
ee_roundcube = "1.0.4"
ee_vimbadmin = "3.0.10"
ee_vimbadmin = "3.0.11"
# Current date and time of System
ee_date = datetime.datetime.now().strftime('%d%b%Y%H%M%S')

Loading…
Cancel
Save