Browse Source

ee subcommand controllers

bugfixes
harshadyeola 10 years ago
parent
commit
3bdfb2a17d
  1. 6
      ee/cli/bootstrap.py
  2. 13
      ee/cli/controllers/clean.py
  3. 17
      ee/cli/controllers/debug.py
  4. 21
      ee/cli/controllers/info.py
  5. 21
      ee/cli/controllers/isl.py
  6. 22
      ee/cli/controllers/secure.py
  7. 74
      ee/cli/controllers/site.py
  8. 11
      ee/cli/controllers/stack.py

6
ee/cli/bootstrap.py

@ -11,6 +11,9 @@ from ee.cli.controllers.site import EESiteUpdateController
from ee.cli.controllers.stack import EEStackController
from ee.cli.controllers.debug import EEDebugController
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
def load(app):
handler.register(EEBaseController)
@ -20,3 +23,6 @@ def load(app):
handler.register(EEStackController)
handler.register(EEDebugController)
handler.register(EECleanController)
handler.register(EEInfoController)
handler.register(EEImportslowlogController)
handler.register(EESecureController)

13
ee/cli/controllers/clean.py

@ -9,14 +9,19 @@ class EECleanController(CementBaseController):
stacked_type = 'nested'
description = 'clean command cleans different cache with following options'
arguments = [
(['-f', '--foo'],
dict(help='the notorious foo option', dest='foo', action='store',
metavar='TEXT') ),
(['--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):
# Default action for ee clean command
# TODO Default action for ee clean command here
print ("Inside EECleanController.default().")
# clean command Options and subcommand calls and definations to

17
ee/cli/controllers/debug.py

@ -9,14 +9,23 @@ class EEDebugController(CementBaseController):
stacked_type = 'nested'
description = 'debug command used for debugging issued with stack or site specific configuration'
arguments = [
(['-f', '--foo'],
dict(help='the notorious foo option', dest='foo', action='store',
metavar='TEXT') ),
(['--fpm'],
dict(help='debug fpm', action='store_true') ),
(['--mysql'],
dict(help='debug mysql', action='store_true') ),
(['--nginx'],
dict(help='debug nginx', action='store_true') ),
(['--php'],
dict(help='debug php', action='store_true') ),
(['--rewrite'],
dict(help='debug rewrite', action='store_true') ),
(['--stop'],
dict(help='stop debugging', action='store_true') ),
]
@expose(hide=True)
def default(self):
# Default action for ee debug command
# TODO Default action for ee debug command
print ("Inside EEDebugController.default().")
# debug command Options and subcommand calls and definations to

21
ee/cli/controllers/info.py

@ -0,0 +1,21 @@
from cement.core.controller import CementBaseController, expose
class EEInfoController(CementBaseController):
class Meta:
label = 'info'
stacked_on = 'base'
stacked_type = 'nested'
description = 'info command used for debugging issued with stack or site specific configuration'
arguments = [
(['--mysql'],
dict(help='get mysql configuration information', action='store_true') ),
(['--php'],
dict(help='get php configuration information', action='store_true') ),
(['--nginx'],
dict(help='get nginx configuration information', action='store_true') ),
]
@expose(hide=True)
def default(self):
# Default action for ee debug command
print ("Inside EEInfoController.default().")

21
ee/cli/controllers/isl.py

@ -0,0 +1,21 @@
from cement.core.controller import CementBaseController, expose
class EEImportslowlogController(CementBaseController):
class Meta:
label = 'import_slow_log'
stacked_on = 'base'
stacked_type = 'nested'
description = 'info command used for debugging issued with stack or site specific configuration'
arguments = [
(['--mysql'],
dict(help='get mysql configuration information', action='store_true') ),
(['--php'],
dict(help='get php configuration information', action='store_true') ),
(['--nginx'],
dict(help='get nginx configuration information', action='store_true') ),
]
@expose(hide=True)
def default(self):
# TODO Default action for ee debug command
print ("Inside EEImprtslowlogController.default().")

22
ee/cli/controllers/secure.py

@ -0,0 +1,22 @@
from cement.core.controller import CementBaseController, expose
class EESecureController(CementBaseController):
class Meta:
label = 'secure'
stacked_on = 'base'
stacked_type = 'nested'
description = 'secure command used for debugging issued with stack or site specific configuration'
arguments = [
(['--ip'],
dict(help='whitelist ip addresses to access admin tools without authentication',
action='store_true') ),
(['--auth'],
dict(help='change http auth credentials', action='store_true') ),
(['--port'],
dict(help='change port for admin tools default is 22222', action='store_true') ),
]
@expose(hide=True)
def default(self):
# Default action for ee debug command
print ("Inside EESecureController.default().")

74
ee/cli/controllers/site.py

@ -10,7 +10,8 @@ class EESiteController(CementBaseController):
stacked_type = 'nested'
description = 'site command manages website configuration with the help of the following subcommands'
arguments = [
(['site_name'], dict(help='the notorious foo option') ),
(['site_name'],
dict(help='website name') ),
]
@expose(hide=True)
@ -64,19 +65,7 @@ class EESiteController(CementBaseController):
print("Inside EESiteController.cd().")
# site 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/``.
#
class EESiteCreateController(CementBaseController):
class Meta:
@ -85,13 +74,20 @@ class EESiteCreateController(CementBaseController):
stacked_type = 'nested'
description = 'create command manages website configuration with the help of the following subcommands'
arguments = [
(['site_name'], dict(help='the notorious foo option') ),
(['--html'], dict(help="html site", action='store_true')),
(['--php'], dict(help="php site", action='store_true')),
(['--mysql'], dict(help="mysql site", action='store_true')),
(['--wp'], dict(help="wordpress site", action='store_true')),
(['--wpsubdir'], dict(help="wpsubdir site", action='store_true')),
(['--wpsubdomain'], dict(help="wpsubdomain site", action='store_true')),
(['site_name'],
dict(help='the notorious foo option') ),
(['--html'],
dict(help="html site", action='store_true')),
(['--php'],
dict(help="php site", action='store_true')),
(['--mysql'],
dict(help="mysql site", action='store_true')),
(['--wp'],
dict(help="wordpress site", action='store_true')),
(['--wpsubdir'],
dict(help="wpsubdir site", action='store_true')),
(['--wpsubdomain'],
dict(help="wpsubdomain site", action='store_true')),
]
@expose(hide=True)
@ -106,15 +102,39 @@ class EESiteUpdateController(CementBaseController):
stacked_type = 'nested'
description = 'update command manages website configuration with the help of the following subcommands'
arguments = [
(['site_name'], dict(help='website name', nargs="1") ),
(['--html'], dict(help="html site", action='store_true')),
(['--php'], dict(help="php site", action='store_true')),
(['--mysql'], dict(help="mysql site", action='store_true')),
(['--wp'], dict(help="wordpress site", action='store_true')),
(['--wpsubdir'], dict(help="wpsubdir site", action='store_true')),
(['--wpsubdomain'], dict(help="wpsubdomain site", action='store_true')),
(['site_name'],
dict(help='website name', nargs="1") ),
(['--html'],
dict(help="html site", action='store_true')),
(['--php'],
dict(help="php site", action='store_true')),
(['--mysql'],
dict(help="mysql site", action='store_true')),
(['--wp'],
dict(help="wordpress site", action='store_true')),
(['--wpsubdir'],
dict(help="wpsubdir site", action='store_true')),
(['--wpsubdomain'],
dict(help="wpsubdomain site", action='store_true')),
]
@expose(help="update example.com")
def default(self):
# TODO Write code for ee site update here
print("Inside EESiteUpdateController.default().")
# site 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/``.
#

11
ee/cli/controllers/stack.py

@ -9,14 +9,17 @@ class EEStackController(CementBaseController):
stacked_type = 'nested'
description = 'stack command manages stack operations'
arguments = [
(['-f', '--foo'],
dict(help='the notorious foo option', dest='foo', action='store',
metavar='TEXT') ),
(['--web'],
dict(help='Install web stack', action='store_true') ),
(['--admin'],
dict(help='Install admin tools stack', action='store_true') ),
(['--mail'],
dict(help='Install mail server stack', action='store_true') ),
]
@expose(hide=True)
def default(self):
# Default action for ee stack command
# TODO Default action for ee stack command
print ("Inside EEStackController.default().")
# stack command Options and subcommand calls and definations to

Loading…
Cancel
Save