Browse Source

completed ee clean command

bugfixes
shital.rtcamp 10 years ago
parent
commit
9870f0085c
  1. 2
      ee/cli/bootstrap.py
  2. 41
      ee/cli/controllers/clean.py
  3. 4
      ee/core/services.py

2
ee/cli/bootstrap.py

@ -5,7 +5,6 @@
from cement.core import handler
from ee.cli.controllers.base import EEBaseController
from ee.cli.controllers.clean import EECleanController
from ee.cli.controllers.secure import EESecureController
from ee.cli.controllers.isl import EEImportslowlogController
from ee.cli.controllers.info import EEInfoController
@ -13,7 +12,6 @@ from ee.cli.controllers.info import EEInfoController
def load(app):
handler.register(EEBaseController)
handler.register(EECleanController)
handler.register(EEInfoController)
handler.register(EEImportslowlogController)
handler.register(EESecureController)

41
ee/cli/controllers/clean.py

@ -1,41 +0,0 @@
"""EasyEngine site controller."""
from cement.core.controller import CementBaseController, expose
class EECleanController(CementBaseController):
class Meta:
label = 'clean'
stacked_on = 'base'
stacked_type = 'nested'
description = 'clean command cleans different cache with following \
options'
arguments = [
(['--all'],
dict(help='clean all cache', action='store_true')),
(['--fastcgi'],
dict(help='clean fastcgi cache', action='store_true')),
(['--memcache'],
dict(help='clean memcache', action='store_true')),
(['--opcache'],
dict(help='clean opcode cache cache', action='store_true'))
]
@expose(hide=True)
def default(self):
# TODO Default action for ee clean command here
print("Inside EECleanController.default().")
# clean command Options and subcommand calls and definations to
# mention here
# If using an output handler such as 'mustache', you could also
# render a data dictionary using a template. For example:
#
# data = dict(foo='bar')
# self.app.render(data, 'default.mustache')
#
#
# The 'default.mustache' file would be loaded from
# ``ee.cli.templates``, or ``/var/lib/ee/templates/``.
#

4
ee/core/services.py

@ -38,8 +38,8 @@ class EEService():
def restart_service(self, service_name):
try:
EEService.stop_service(service_name)
EEService.start_service(service_name)
EEService.stop_service(self, service_name)
EEService.start_service(self, service_name)
except OSError as e:
self.app.log.error("Execution failed:", e)

Loading…
Cancel
Save