@expose(help="Remove packages")
    def remove(self):
        apt_packages = []
        packages = []

        # Default action for stack remove
        if ((not self.app.pargs.web) and (not self.app.pargs.admin) and
           (not self.app.pargs.mail) and (not self.app.pargs.nginx) and
           (not self.app.pargs.php) and (not self.app.pargs.php7) and (not self.app.pargs.mysql) and
           (not self.app.pargs.postfix) and (not self.app.pargs.wpcli) and
           (not self.app.pargs.phpmyadmin) and (not self.app.pargs.hhvm) and
           (not self.app.pargs.adminer) and (not self.app.pargs.utils) and
           (not self.app.pargs.mailscanner) and (not self.app.pargs.all) and
           (not self.app.pargs.pagespeed) and (not self.app.pargs.redis) and
           (not self.app.pargs.phpredisadmin) and (not self.app.pargs.nginxmainline)):
            self.app.pargs.web = True
            self.app.pargs.admin = True

        if self.app.pargs.all:
            self.app.pargs.web = True
            self.app.pargs.admin = True
            self.app.pargs.mail = True
            if EEVariables.ee_platform_codename == 'trusty':
                self.app.pargs.php7 = True

        if self.app.pargs.web:
            self.app.pargs.nginx = True
            self.app.pargs.php = True
            self.app.pargs.mysql = True
            self.app.pargs.wpcli = True
            self.app.pargs.postfix = True

        if self.app.pargs.admin:
            self.app.pargs.adminer = True
            self.app.pargs.phpmyadmin = True
            self.app.pargs.utils = True

        if self.app.pargs.mail:
            Log.debug(self, "Removing mail server packages")
            apt_packages = apt_packages + EEVariables.ee_mail
            apt_packages = apt_packages + EEVariables.ee_mailscanner
            packages = packages + ["{0}22222/htdocs/vimbadmin"
                                   .format(EEVariables.ee_webroot),
                                   "{0}roundcubemail"
                                   .format(EEVariables.ee_webroot)]
            if EEShellExec.cmd_exec(self, "mysqladmin ping"):
                EEMysql.execute(self, "drop database IF EXISTS vimbadmin")
                EEMysql.execute(self, "drop database IF EXISTS roundcubemail")

        if self.app.pargs.mailscanner:
            apt_packages = (apt_packages + EEVariables.ee_mailscanner)

        if self.app.pargs.pagespeed:
            Log.debug(self, "Removing packages varible of Pagespeed")
            packages = packages + ['/etc/nginx/conf.d/pagespeed.conf']

        if self.app.pargs.nginx:
            if EEAptGet.is_installed(self, 'nginx-custom'):
                Log.debug(self, "Removing apt_packages variable of Nginx")
                apt_packages = apt_packages + EEVariables.ee_nginx
            else:
                Log.error(self,"Cannot Remove! Nginx Stable version not found.")
        if self.app.pargs.nginxmainline:
            if EEAptGet.is_installed(self, 'nginx-mainline'):
                Log.debug(self, "Removing apt_packages variable of Nginx MAINLINE")
                apt_packages = apt_packages + EEVariables.ee_nginx_dev
            else:
                Log.error(self,"Cannot Remove! Nginx Mainline version not found.")
        if self.app.pargs.php:
            Log.debug(self, "Removing apt_packages variable of PHP")
            if EEVariables.ee_platform_codename == 'trusty':
                apt_packages = apt_packages + EEVariables.ee_php5_6
                if not EEAptGet.is_installed(self, 'php7.0-fpm'):
                    apt_packages = apt_packages + EEVariables.ee_php_extra
            else:
                apt_packages = apt_packages + EEVariables.ee_php

        if self.app.pargs.php7:
            if EEVariables.ee_platform_codename == 'trusty':
                Log.debug(self, "Removing apt_packages variable of PHP 7.0")
                apt_packages = apt_packages + EEVariables.ee_php7_0
                if not EEAptGet.is_installed(self, 'php5.6-fpm'):
                    apt_packages = apt_packages + EEVariables.ee_php_extra
            else:
                Log.info(self,"PHP 7.0 not supported.")

        if self.app.pargs.hhvm:
            if EEAptGet.is_installed(self, 'hhvm'):
                Log.debug(self, "Removing apt_packages variable of HHVM")
                apt_packages = apt_packages + EEVariables.ee_hhvm
        if self.app.pargs.redis:
            Log.debug(self, "Remove apt_packages variable of Redis")
            apt_packages = apt_packages + EEVariables.ee_redis
        if self.app.pargs.mysql:
            Log.debug(self, "Removing apt_packages variable of MySQL")
            apt_packages = apt_packages + EEVariables.ee_mysql
            packages = packages + ['/usr/bin/mysqltuner']
        if self.app.pargs.postfix:
            Log.debug(self, "Removing apt_packages variable of Postfix")
            apt_packages = apt_packages + EEVariables.ee_postfix
        if self.app.pargs.wpcli:
            Log.debug(self, "Removing package variable of WPCLI ")
            if os.path.isfile('/usr/bin/wp'):
                packages = packages + ['/usr/bin/wp']
            else:
                Log.warn(self, "WP-CLI is not installed with EasyEngine")
        if self.app.pargs.phpmyadmin:
            Log.debug(self, "Removing package variable of phpMyAdmin ")
            packages = packages + ['{0}22222/htdocs/db/pma'
                                   .format(EEVariables.ee_webroot)]
        if self.app.pargs.phpredisadmin:
            Log.debug(self, "Removing package variable of phpRedisAdmin ")
            packages = packages + ['{0}22222/htdocs/cache/redis/phpRedisAdmin'
                                   .format(EEVariables.ee_webroot)]
        if self.app.pargs.adminer:
            Log.debug(self, "Removing package variable of Adminer ")
            packages = packages + ['{0}22222/htdocs/db/adminer'
                                   .format(EEVariables.ee_webroot)]
        if self.app.pargs.utils:
            Log.debug(self, "Removing package variable of utils ")
            packages = packages + ['{0}22222/htdocs/php/webgrind/'
                                   .format(EEVariables.ee_webroot),
                                   '{0}22222/htdocs/cache/opcache'
                                   .format(EEVariables.ee_webroot),
                                   '{0}22222/htdocs/cache/nginx/'
                                   'clean.php'.format(EEVariables.ee_webroot),
                                   '{0}22222/htdocs/cache/memcache'
                                   .format(EEVariables.ee_webroot),
                                   '/usr/bin/pt-query-advisor',
                                   '{0}22222/htdocs/db/anemometer'
                                   .format(EEVariables.ee_webroot)]

        if len(packages) or len(apt_packages):
            ee_prompt = input('Are you sure you to want to'
                              ' remove from server.'
                              '\nPackage configuration will remain'
                              ' on server after this operation.\n'
                              'Any answer other than '
                              '"yes" will be stop this'
                              ' operation :  ')

            if ee_prompt == 'YES' or ee_prompt == 'yes':

                if (set(["nginx-mainline"]).issubset(set(apt_packages)) or
                        set(["nginx-custom"]).issubset(set(apt_packages))) :
                    EEService.stop_service(self, 'nginx')

                if len(packages):
                    EEFileUtils.remove(self, packages)
                    EEAptGet.auto_remove(self)

                if len(apt_packages):
                    Log.debug(self, "Removing apt_packages")
                    Log.info(self, "Removing packages, please wait...")
                    EEAptGet.remove(self, apt_packages)
                    EEAptGet.auto_remove(self)

                if set(["nginx-mainline"]).issubset(set(apt_packages)):
                    Log.info(self, "Removing repository for NGINX MAINLINE,")
                    EERepo.remove(self, repo_url=EEVariables.ee_nginx_dev_repo)


                Log.info(self, "Successfully removed packages")

                if self.app.pargs.php7:
                    if EEAptGet.is_installed(self, 'php5.6-fpm'):
                        Log.info(self, "PHP5.6-fpm found on system.")
                        Log.info(self, "Verifying and installing missing packages,")
                        EEShellExec.cmd_exec(self, "apt-get install -y php-memcached php-igbinary")
Recieve a payload from the underlying audio stream, blocking if necessary
dataset/ETHPy150Open EasyEngine/easyengine/ee/cli/plugins/stack.py/EEStackController.remove--crossover with--dataset/ETHPy150Open richo/groundstation/groundstation/audio_discoverer.py/AudioDiscoverer.recv