Browse Source

minor fix

bugfixes
harshadyeola 10 years ago
parent
commit
50d60c17ca
  1. 17
      ee/cli/plugins/site.py
  2. 5
      ee/cli/plugins/site_functions.py
  3. 13
      ee/cli/plugins/stack.py
  4. 4
      ee/core/aptget.py
  5. 2
      ee/core/fileutils.py

17
ee/cli/plugins/site.py

@ -26,8 +26,7 @@ class EESiteController(CementBaseController):
label = 'site'
stacked_on = 'base'
stacked_type = 'nested'
description = ('Site command manages website configuration'
' with the help of the following subcommands')
description = ('Performs website specific operations')
arguments = [
(['site_name'],
dict(help='Website name')),
@ -405,7 +404,7 @@ class EESiteCreateController(CementBaseController):
self.app.close(1)
# Check rerequired packages are installed or not
site_package_check(self, stype)
ee_auth = site_package_check(self, stype)
# setup NGINX configuration, and webroot
setupdomain(self, data)
# Setup database for MySQL site
@ -440,10 +439,14 @@ class EESiteCreateController(CementBaseController):
.format(ee_www_domain, stype, cache))
# Setup Permissions for webroot
setwebrootpermissions(self, data['webroot'])
if len(ee_auth):
for msg in ee_auth:
Log.info(self, Log.ENDC + msg)
if data['wp']:
Log.info(self, Log.ENDC + "WordPress Admin User :"
Log.info(self, Log.ENDC + "WordPress admin user :"
" {0}".format(ee_wp_creds['wp_user']))
Log.info(self, Log.ENDC + "WordPress Admin User Password : {0}"
Log.info(self, Log.ENDC + "WordPress admin user password : {0}"
.format(ee_wp_creds['wp_pass']))
addNewSite(self, ee_www_domain, stype, cache, ee_site_webroot)
Log.info(self, "Successfully created site"
@ -882,9 +885,9 @@ class EESiteUpdateController(CementBaseController):
# setwebrootpermissions(self, data['webroot'])
if data['wp'] and oldsitetype in ['html', 'php', 'mysql']:
Log.info(self, Log.ENDC + "WordPress Admin User :"
Log.info(self, Log.ENDC + "WordPress admin user :"
" {0}".format(ee_wp_creds['wp_user']))
Log.info(self, Log.ENDC + "WordPress Admin User Password : {0}"
Log.info(self, Log.ENDC + "WordPress admin password : {0}"
.format(ee_wp_creds['wp_pass']))
updateSiteInfo(self, ee_www_domain, stype=stype, cache=cache)

5
ee/cli/plugins/site_functions.py

@ -17,7 +17,7 @@ def setupdomain(self, data):
ee_domain_name = data['site_name']
ee_site_webroot = data['webroot']
Log.info(self, "Setting up NGINX configuration \t\t", end='')
Log.info(self, "Setting up NGINX configuration \t", end='')
# write nginx config for file
try:
ee_site_nginx_conf = open('/etc/nginx/sites-available/{0}'
@ -376,7 +376,8 @@ def site_package_check(self, stype):
"releases/download/v0.17.1/"
"wp-cli.phar", "/usr/bin/wp",
"WP_CLI"]]
stack.install(apt_packages=apt_packages, packages=packages)
return(stack.install(apt_packages=apt_packages, packages=packages,
disp_msg=False))
def updatewpuserpassword(self, ee_domain, ee_site_webroot):

13
ee/cli/plugins/stack.py

@ -911,7 +911,7 @@ class EEStackController(CementBaseController):
EEVariables.ee_php_user, recursive=True)
@expose(help="Install packages")
def install(self, packages=[], apt_packages=[]):
def install(self, packages=[], apt_packages=[], disp_msg=True):
self.msg = []
try:
# Default action for stack installation
@ -1072,10 +1072,13 @@ class EEStackController(CementBaseController):
EEDownload.download(self, packages)
Log.debug(self, "Calling post_pref")
self.post_pref(apt_packages, packages)
if len(self.msg):
for msg in self.msg:
Log.info(self, msg)
Log.info(self, "Successfully installed packages")
if disp_msg:
if len(self.msg):
for msg in self.msg:
Log.info(self, Log.ENDC + msg)
Log.info(self, "Successfully installed packages")
else:
return self.msg
@expose(help="Remove packages")
def remove(self):

4
ee/core/aptget.py

@ -15,7 +15,7 @@ class EEAptGet():
cache = apt.Cache()
fprogress = apt.progress.text.AcquireProgress()
iprogress = apt.progress.base.InstallProgress()
cache.update(fprogress)
cache.update()
cache.close()
def upgrade(self, packages):
@ -116,7 +116,7 @@ class EEAptGet():
.format(space=cache.required_space/1e6))
try:
# Commit changes in cache (actually install)
cache.commit(fprogress, iprogress)
cache.commit()
except Exception as e:
print("package installation failed. [{err}]"
.format(err=str(e)))

2
ee/core/fileutils.py

@ -74,7 +74,7 @@ class EEFileUtils():
try:
shutil.move(src, dst)
except shutil.Error as e:
Log.debug(self, "{err}".format(err=str(e.reason)))
Log.debug(self, "{err}".format(err=e))
Log.error(self, 'Unable to move file from {0} to {1}'
.format(src, dst))

Loading…
Cancel
Save