Browse Source

reverting to old nginx while migrating

develop
Prabuddha Chakraborty 9 years ago
parent
commit
357691ac21
  1. 11
      ee/cli/plugins/stack.py
  2. 5
      ee/core/aptget.py

11
ee/cli/plugins/stack.py

@ -1699,21 +1699,22 @@ class EEStackController(CementBaseController):
'operation.') 'operation.')
ee_prompt = input("Type \"YES\" or \"yes\" to continue [n]: ") ee_prompt = input("Type \"YES\" or \"yes\" to continue [n]: ")
if ee_prompt == 'YES' or ee_prompt == 'yes': if ee_prompt == 'YES' or ee_prompt == 'yes':
Log.info(self,"Initializing... Please Wait")
EERepo.remove(self, repo_url=EEVariables.ee_nginx_dev_repo)
if EEAptGet.download_only(self,EEVariables.ee_nginx,EEVariables.ee_nginx_repo,EEVariables.ee_nginx_key):
EEService.stop_service(self, 'nginx') EEService.stop_service(self, 'nginx')
Log.debug(self, "Removing apt_packages variable of NGINX") Log.debug(self, "Removing apt_packages variable of NGINX")
Log.info(self, "Removing packages, please wait...") Log.info(self, "Removing packages, please wait...")
EEAptGet.remove(self, EEVariables.ee_nginx_dev) EEAptGet.remove(self, EEVariables.ee_nginx_dev)
EEAptGet.auto_remove(self) EEAptGet.auto_remove(self)
Log.info(self, "Removing repository for NGINX MAINLINE,") Log.info(self, "Removing repository for NGINX MAINLINE,")
EERepo.remove(self, repo_url=EEVariables.ee_nginx_dev_repo)
Log.info(self, "Successfully removed packages") Log.info(self, "Successfully removed packages")
Log.info(self,"Initializing NGINX Mainline Packages... Please Wait")
if EEAptGet.download_only(self,EEVariables.ee_nginx,EEVariables.ee_nginx_repo,EEVariables.ee_nginx_key):
apt_packages = apt_packages + EEVariables.ee_nginx apt_packages = apt_packages + EEVariables.ee_nginx
else: else:
#revert the changes #revert the changes
EERepo.add(self, repo_url=EEVariables.ee_nginx_dev_repo) EERepo.add(self, repo_url=EEVariables.ee_nginx_dev_repo)
Log.error(self,"Skipped installing NGINX Stable") Log.error(self,"Error installing NGINX Stable\nReverting back to NGINX Mainline ..",False)
apt_packages = apt_packages + EEVariables.ee_nginx_dev
if self.app.pargs.nginxmainline: if self.app.pargs.nginxmainline:
if EEVariables.ee_nginx_dev_repo == None: if EEVariables.ee_nginx_dev_repo == None:
@ -1747,7 +1748,7 @@ class EEStackController(CementBaseController):
Log.info(self, "Successfully removed packages") Log.info(self, "Successfully removed packages")
apt_packages = apt_packages + EEVariables.ee_nginx_dev apt_packages = apt_packages + EEVariables.ee_nginx_dev
else: else:
Log.error(self,"Skipped installing NGINX Mainline") Log.error(self,"Skipped installing NGINX Mainline",False)
if self.app.pargs.php: if self.app.pargs.php:
Log.debug(self, "Setting apt_packages variable for PHP") Log.debug(self, "Setting apt_packages variable for PHP")

5
ee/core/aptget.py

@ -200,19 +200,20 @@ class EEAptGet():
""" """
Similar to `apt-get install --download-only` Similar to `apt-get install --download-only`
""" """
packages = ' '.join(package_name)
try: try:
with open('/var/log/ee/ee.log', 'a') as f: with open('/var/log/ee/ee.log', 'a') as f:
if repo_url is not None: if repo_url is not None:
EERepo.add(self, repo_url=repo_url) EERepo.add(self, repo_url=repo_url)
if repo_key is not None: if repo_key is not None:
EERepo.add_key(self, repo_key) EERepo.add_key(self, repo_key)
proc = subprocess.Popen("DEBIAN_FRONTEND=noninteractive " proc = subprocess.Popen("apt-get update && DEBIAN_FRONTEND=noninteractive "
"apt-get install -o " "apt-get install -o "
"Dpkg::Options::=\"--force-confdef\"" "Dpkg::Options::=\"--force-confdef\""
" -o " " -o "
"Dpkg::Options::=\"--force-confold\"" "Dpkg::Options::=\"--force-confold\""
" -y --download-only {0}" " -y --download-only {0}"
.format(package_name), shell=True, .format(packages), shell=True,
stdin=None, stdout=f, stderr=f, stdin=None, stdout=f, stderr=f,
executable="/bin/bash") executable="/bin/bash")
proc.wait() proc.wait()

Loading…
Cancel
Save