Browse Source

updated ee stack class

feature/plugin
harshadyeola 10 years ago
parent
commit
929b8e3d2e
  1. 29
      ee/cli/plugins/eestack.py
  2. 5
      ee/cli/plugins/stack.py

29
ee/cli/plugins/eestack.py

@ -1,6 +1,6 @@
"""EasyEnging stack Interface"""
from ee.core.aptget import EEAptGet
class EEStack(object):
@ -10,27 +10,40 @@ class EEStack(object):
def __init__(self, package_name):
"""
package_name: specify the name of package the operation
packages_name: specify the name of package the operation
to be performed on
"""
self.package_name=package_name
self.packages_name=package_name
def install_stack(self, package_name):
def install_stack(self):
"""
Installs the package on system
"""
pass
print(self.packages_name)
EEAptGet.install(self, self.packages_name)
def remove_stack(self, package_name):
def remove_stack(self):
"""
Removes the package on system
"""
pass
EEAptGet.remove(self, self.packages_name)
EEAptGet.auto_remove(self)
def purge_stack(self):
"""
Purge the package from system
"""
EEAptGet.remove(self, self.packages_name, purge=True)
EEAptGet.auto_remove(self)
def _is_installed(self, package_name):
def _is_installed(self):
"""
Check if package is already installed
Return
True: if package is installed
False: if package is not installed
"""
result = dict()
for package in self.packages_name():
result.update({package: EEAptGet.is_installed(self, package)})
return result

5
ee/cli/plugins/stack.py

@ -78,7 +78,10 @@ class EEStackController(CementBaseController):
@expose(hide=True)
def default(self):
"""default action of ee stack command"""
from ee.cli.plugins.mailstack import EEMailStack
EEMailStack(self).install_stack()
self.app.args.print_help()
EEMailStack(self).purged_stack()
@expose(hide=True)
def pre_pref(self, apt_packages):
@ -475,7 +478,7 @@ class EEStackController(CementBaseController):
.format(EEVariables.ee_webroot))
except CommandExecutionError as e:
Log.error(self, "Failed to generate SSL for 22222")
self.log.error(self, "Failed to generate SSL for 22222")
# Nginx Configation into GIT
EEGit.add(self,

Loading…
Cancel
Save