Fix stack remove/purge

This commit is contained in:
VirtuBox
2019-08-29 15:35:03 +02:00
parent f20766bf1b
commit 5f983581c4

View File

@@ -277,10 +277,10 @@ class WOStackController(CementBaseController):
# PHPMYADMIN # PHPMYADMIN
if pargs.phpmyadmin: if pargs.phpmyadmin:
pargs.composer = True
if not os.path.isdir('/var/www/22222/htdocs/db/pma'): if not os.path.isdir('/var/www/22222/htdocs/db/pma'):
Log.debug(self, "Setting packages variable " Log.debug(self, "Setting packages variable "
"for phpMyAdmin ") "for phpMyAdmin ")
pargs.composer = True
packages = packages + [["https://github.com/phpmyadmin/" packages = packages + [["https://github.com/phpmyadmin/"
"phpmyadmin/archive/STABLE.tar.gz", "phpmyadmin/archive/STABLE.tar.gz",
"/var/lib/wo/tmp/pma.tar.gz", "/var/lib/wo/tmp/pma.tar.gz",
@@ -289,6 +289,23 @@ class WOStackController(CementBaseController):
Log.debug(self, "phpMyAdmin already installed") Log.debug(self, "phpMyAdmin already installed")
Log.info(self, "phpMyAdmin already installed") Log.info(self, "phpMyAdmin already installed")
# PHPREDISADMIN
if pargs.phpredisadmin:
pargs.composer = True
if not os.path.isdir('/var/www/22222/htdocs/'
'cache/redis/phpRedisAdmin'):
Log.debug(
self, "Setting packages variable for phpRedisAdmin")
packages = packages + [["https://github.com/"
"erikdubbelboer/"
"phpRedisAdmin/archive"
"/v1.11.3.tar.gz",
"/var/lib/wo/tmp/pra.tar.gz",
"phpRedisAdmin"]]
else:
Log.debug(self, "phpRedisAdmin already installed")
Log.info(self, "phpRedisAdmin already installed")
# Composer # Composer
if pargs.composer: if pargs.composer:
if not os.path.isfile('/usr/local/bin/composer'): if not os.path.isfile('/usr/local/bin/composer'):
@@ -301,23 +318,6 @@ class WOStackController(CementBaseController):
Log.debug(self, "Composer already installed") Log.debug(self, "Composer already installed")
Log.info(self, "Composer already installed") Log.info(self, "Composer already installed")
# PHPREDISADMIN
if pargs.phpredisadmin:
if not os.path.isdir('/var/www/22222/htdocs/'
'cache/redis/phpRedisAdmin'):
Log.debug(
self, "Setting packages variable for phpRedisAdmin")
pargs.composer = True
packages = packages + [["https://github.com/"
"erikdubbelboer/"
"phpRedisAdmin/archive"
"/v1.11.3.tar.gz",
"/var/lib/wo/tmp/pra.tar.gz",
"phpRedisAdmin"]]
else:
Log.debug(self, "phpRedisAdmin already installed")
Log.info(self, "phpRedisAdmin already installed")
# ADMINER # ADMINER
if pargs.adminer: if pargs.adminer:
Log.debug(self, "Setting packages variable for Adminer ") Log.debug(self, "Setting packages variable for Adminer ")
@@ -632,17 +632,15 @@ class WOStackController(CementBaseController):
.format(WOVariables.wo_webroot)] .format(WOVariables.wo_webroot)]
if (packages) or (apt_packages): if (packages) or (apt_packages):
if not pargs.force: if (not pargs.force):
wo_prompt = input('Are you sure you to want to' start_remove = input('Are you sure you to want to'
' remove from server.' ' remove from server.'
'\nPackage configuration will remain' '\nPackage configuration will remain'
' on server after this operation.\n' ' on server after this operation.\n'
'Any answer other than ' 'Remove stacks [y/N]')
'"yes" will be stop this' if start_remove != "Y" and start_remove != "y":
' operation : ') Log.error(self, "Not starting stack removal")
if (wo_prompt != 'YES' or wo_prompt != 'yes'): Log.info(self, "Removing stacks, please wait...")
Log.error(self, "Not removing packages")
if (set(["nginx-custom"]).issubset(set(apt_packages))): if (set(["nginx-custom"]).issubset(set(apt_packages))):
WOService.stop_service(self, 'nginx') WOService.stop_service(self, 'nginx')
@@ -813,15 +811,16 @@ class WOStackController(CementBaseController):
.format(WOVariables.wo_webroot)] .format(WOVariables.wo_webroot)]
if (packages) or (apt_packages): if (packages) or (apt_packages):
if not pargs.force: if (not pargs.force):
wo_prompt = input('Are you sure you to want to purge ' start_purge = input('Are you sure you to want to'
'from server ' ' purge stacks from this server ?'
'along with their configuration' '\nPackage configuration and data '
' packages,\nAny answer other than ' 'will not remain'
'"yes" will be stop this ' ' on this server after this operation.\n'
'operation :') 'Purge stacks [y/N]')
if (wo_prompt != 'YES' or wo_prompt != 'yes'): if start_purge != "Y" and start_purge != "y":
Log.error(self, "Not purging packages") Log.error(self, "Not starting stack purge")
Log.info(self, "Purging stacks, please wait...")
if (set(["nginx-custom"]).issubset(set(apt_packages))): if (set(["nginx-custom"]).issubset(set(apt_packages))):
WOService.stop_service(self, 'nginx') WOService.stop_service(self, 'nginx')