Browse Source

minor chnages

bugfixes
shitalp 10 years ago
parent
commit
32d55234eb
  1. 31
      ee/cli/plugins/stack.py

31
ee/cli/plugins/stack.py

@ -70,6 +70,9 @@ class EEStackController(CementBaseController):
dict(help='Install Adminer stack', action='store_true')), dict(help='Install Adminer stack', action='store_true')),
(['--utils'], (['--utils'],
dict(help='Install Utils stack', action='store_true')), dict(help='Install Utils stack', action='store_true')),
(['--prompt'],
dict(help="ask permission for delete",
action='store_true')),
] ]
usage = "ee stack (command) [options]" usage = "ee stack (command) [options]"
@ -1667,33 +1670,33 @@ class EEStackController(CementBaseController):
.format(EEVariables.ee_webroot)] .format(EEVariables.ee_webroot)]
if len(apt_packages): if len(apt_packages):
if not self.app.pargs.no_prompt: if self.app.pargs.prompt:
ee_apt_pkg_prompt = input('Are you sure you to want to' ee_apt_pkg_prompt = input('Are you sure you to want to'
' purge from server' ' purge from server'
'. Package configuration will remain' '. Package configuration will remain'
' on server after this operation.' ' on server after this operation.'
' packages Any answer other than ' ' Any answer other than '
' "yes" will be stop this' ' "yes" will be stop this'
' operation ') ' operation ')
else: else:
ee_apt_pkg_prompt = 'Y' ee_apt_pkg_prompt = 'YES'
if ee_apt_pkg_prompt == 'Y' or ee_apt_pkg_prompt == 'y': if ee_apt_pkg_prompt == 'YES' or ee_apt_pkg_prompt == 'yes':
Log.debug(self, "Removing apt_packages") Log.debug(self, "Removing apt_packages")
Log.info(self, "Removing packages, please wait ...") Log.info(self, "Removing packages, please wait ...")
EEAptGet.remove(self, apt_packages) EEAptGet.remove(self, apt_packages)
EEAptGet.auto_remove(self) EEAptGet.auto_remove(self)
if len(packages): if len(packages):
if not self.app.pargs.no_prompt: if self.app.pargs.prompt:
ee_pkg_prompt = input('Are you sure you to want to purge' ee_pkg_prompt = input('Are you sure you to want to purge'
' from server.' ' from server.'
' Package configuration will remain ' ' Package configuration will remain '
'on server after this operation.' 'on server after this operation.'
' packages Any answer other than ' ' Any answer other than '
'"yes" will be stop this ' '"yes" will be stop this '
'operation ') 'operation ')
else: else:
ee_pkg_prompt = 'Y' ee_pkg_prompt = 'YES'
if ee_pkg_prompt == 'Y' or ee_pkg_prompt == 'y': if ee_pkg_prompt == 'YES' or ee_pkg_prompt == 'yes':
EEFileUtils.remove(self, packages) EEFileUtils.remove(self, packages)
EEAptGet.auto_remove(self) EEAptGet.auto_remove(self)
Log.info(self, "Successfully removed packages") Log.info(self, "Successfully removed packages")
@ -1790,7 +1793,7 @@ class EEStackController(CementBaseController):
] ]
if len(apt_packages): if len(apt_packages):
if not self.app.pargs.no_prompt: if not self.app.pargs.prompt:
ee_apt_pkg_prompt = input('Are you sure you to want to purge ' ee_apt_pkg_prompt = input('Are you sure you to want to purge '
'from server ' 'from server '
'alongwith their configuration.' 'alongwith their configuration.'
@ -1798,13 +1801,13 @@ class EEStackController(CementBaseController):
'"yes" will be stop this ' '"yes" will be stop this '
'operation ') 'operation ')
else: else:
ee_apt_pkg_prompt = 'Y' ee_apt_pkg_prompt = 'YES'
if ee_apt_pkg_prompt == 'Y' or ee_apt_pkg_prompt == 'y': if ee_apt_pkg_prompt == 'YES' or ee_apt_pkg_prompt == 'yes':
Log.info(self, "Purging packages, please wait ...") Log.info(self, "Purging packages, please wait ...")
EEAptGet.remove(self, apt_packages, purge=True) EEAptGet.remove(self, apt_packages, purge=True)
EEAptGet.auto_remove(self) EEAptGet.auto_remove(self)
if len(packages): if len(packages):
if not self.app.pargs.no_prompt: if not self.app.pargs.prompt:
ee_pkg_prompt = input('Are you sure you to want to purge ' ee_pkg_prompt = input('Are you sure you to want to purge '
' from server alongwith ' ' from server alongwith '
' their configuration.' ' their configuration.'
@ -1812,8 +1815,8 @@ class EEStackController(CementBaseController):
'"yes" will be stop this ' '"yes" will be stop this '
'operation ') 'operation ')
else: else:
ee_pkg_prompt = 'Y' ee_pkg_prompt = 'YES'
if ee_pkg_prompt == 'Y' or ee_pkg_prompt == 'y': if ee_pkg_prompt == 'YES' or ee_pkg_prompt == 'yes':
EEFileUtils.remove(self, packages) EEFileUtils.remove(self, packages)
EEAptGet.auto_remove(self) EEAptGet.auto_remove(self)
Log.info(self, "Successfully purged packages") Log.info(self, "Successfully purged packages")

Loading…
Cancel
Save