Browse Source

description message

bugfixes
harshadyeola 10 years ago
parent
commit
80e7a1b3d3
  1. 4
      ee/cli/plugins/clean.py
  2. 4
      ee/cli/plugins/secure.py
  3. 5
      ee/cli/plugins/site.py
  4. 8
      ee/cli/plugins/stack.py
  5. 3
      ee/core/addswap.py
  6. 6
      ee/core/download.py
  7. 2
      ee/core/extract.py
  8. 6
      ee/core/fileutils.py
  9. 33
      ee/core/services.py
  10. 10
      setup.py

4
ee/cli/plugins/clean.py

@ -18,8 +18,8 @@ class EECleanController(CementBaseController):
label = 'clean' label = 'clean'
stacked_on = 'base' stacked_on = 'base'
stacked_type = 'nested' stacked_type = 'nested'
description = 'clean command cleans different cache with following \ description = ('clean command cleans different cache with following '
options' 'options')
arguments = [ arguments = [
(['--all'], (['--all'],
dict(help='clean all cache', action='store_true')), dict(help='clean all cache', action='store_true')),

4
ee/cli/plugins/secure.py

@ -20,8 +20,8 @@ class EEsecureController(CementBaseController):
label = 'secure' label = 'secure'
stacked_on = 'base' stacked_on = 'base'
stacked_type = 'nested' stacked_type = 'nested'
description = 'clean command cleans different cache with following \ description = ('clean command cleans different cache with following '
options' 'options')
arguments = [ arguments = [
(['--auth'], (['--auth'],
dict(help='secure auth', action='store_true')), dict(help='secure auth', action='store_true')),

5
ee/cli/plugins/site.py

@ -23,8 +23,13 @@ class EESiteController(CementBaseController):
label = 'site' label = 'site'
stacked_on = 'base' stacked_on = 'base'
stacked_type = 'nested' stacked_type = 'nested'
<<<<<<< HEAD
description = ('''site command manages website configuration description = ('''site command manages website configuration
with the help of the following subcommands''') with the help of the following subcommands''')
=======
description = ('site command manages website configuration'
' with the help of the following subcommands')
>>>>>>> 78782f7a7595c1e9d9c8e041c9f081e331f156f8
arguments = [ arguments = [
(['site_name'], (['site_name'],
dict(help='website name')), dict(help='website name')),

8
ee/cli/plugins/stack.py

@ -929,7 +929,7 @@ class EEStackController(CementBaseController):
"roundcubemail/releases/download/" "roundcubemail/releases/download/"
"1.0.4/roundcubemail-1.0.4.tar.gz", "1.0.4/roundcubemail-1.0.4.tar.gz",
"/tmp/roundcube.tar.gz", "/tmp/roundcube.tar.gz",
"roundcubemail"]] "Roundcube"]]
if EEVariables.ee_ram > 1024: if EEVariables.ee_ram > 1024:
apt_packages = apt_packages + EEVariables.ee_mailscanner apt_packages = apt_packages + EEVariables.ee_mailscanner
@ -966,7 +966,7 @@ class EEStackController(CementBaseController):
packages = packages + [["https://github.com/wp-cli/wp-cli/" packages = packages + [["https://github.com/wp-cli/wp-cli/"
"releases/download/v0.17.1/" "releases/download/v0.17.1/"
"wp-cli.phar", "/usr/bin/wp", "wp-cli.phar", "/usr/bin/wp",
"wp-cli"]] "WP_CLI"]]
else: else:
Log.info(self, "WP-CLI is allready installed") Log.info(self, "WP-CLI is allready installed")
if self.app.pargs.phpmyadmin: if self.app.pargs.phpmyadmin:
@ -979,7 +979,7 @@ class EEStackController(CementBaseController):
Log.debug(self, "Setting packages variable for Adminer ") Log.debug(self, "Setting packages variable for Adminer ")
packages = packages + [["http://downloads.sourceforge.net/adminer" packages = packages + [["http://downloads.sourceforge.net/adminer"
"/adminer-4.1.0.php", "/var/www/22222/" "/adminer-4.1.0.php", "/var/www/22222/"
"htdocs/db/adminer/index.php", "adminer"]] "htdocs/db/adminer/index.php", "Adminer"]]
if self.app.pargs.utils: if self.app.pargs.utils:
Log.debug(self, "Setting packages variable for utils") Log.debug(self, "Setting packages variable for utils")
@ -1006,7 +1006,7 @@ class EEStackController(CementBaseController):
"opcache/ocp.php", "ocp.php"], "opcache/ocp.php", "ocp.php"],
["https://github.com/jokkedk/webgrind/" ["https://github.com/jokkedk/webgrind/"
"archive/master.tar.gz", "archive/master.tar.gz",
'/tmp/webgrind.tar.gz', 'webgrind.tar.gz'], '/tmp/webgrind.tar.gz', 'Webgrind'],
["http://bazaar.launchpad.net/~percona-too" ["http://bazaar.launchpad.net/~percona-too"
"lkit-dev/percona-toolkit/2.1/download/he" "lkit-dev/percona-toolkit/2.1/download/he"
"ad:/ptquerydigest-20110624220137-or26tn4" "ad:/ptquerydigest-20110624220137-or26tn4"

3
ee/core/addswap.py

@ -1,6 +1,7 @@
from ee.core.variables import EEVariables from ee.core.variables import EEVariables
from ee.core.shellexec import EEShellExec from ee.core.shellexec import EEShellExec
from ee.core.fileutils import EEFileUtils from ee.core.fileutils import EEFileUtils
from ee.core.logging import Log
class EESwap(): class EESwap():
@ -13,7 +14,7 @@ class EESwap():
def add(self): def add(self):
if EEVariables.ee_ram < 512: if EEVariables.ee_ram < 512:
if EEVariables.ee_swap < 1000: if EEVariables.ee_swap < 1000:
self.app.log.info("Adding SWAP") Log.info(self, "Adding SWAP")
EEShellExec.cmd_exec(self, "dd if=/dev/zero of=/ee-swapfile " EEShellExec.cmd_exec(self, "dd if=/dev/zero of=/ee-swapfile "
"bs=1024 count=1048k") "bs=1024 count=1048k")
EEShellExec.cmd_exec(self, "mkswap /ee-swapfile") EEShellExec.cmd_exec(self, "mkswap /ee-swapfile")

6
ee/core/download.py

@ -22,11 +22,11 @@ class EEDownload():
Log.info(self, "Downloading "+pkg_name+" ...") Log.info(self, "Downloading "+pkg_name+" ...")
urllib.request.urlretrieve(url, filename) urllib.request.urlretrieve(url, filename)
except urllib.error.URLError as e: except urllib.error.URLError as e:
Log.info(self, "Unable to donwload file, [{err}]" Log.error(self, "Unable to donwload file, [{err}] [FAIL]"
.format(err=str(e.reason))) .format(err=str(e.reason)))
return False return False
except urllib.error.HTTPError as e: except urllib.error.HTTPError as e:
Log.error(self, "Package download failed. [{err}]" Log.error(self, "Package download failed. [{err}] [FAIL]"
.format(err=str(e.reason))) .format(err=str(e.reason)))
return False return False
except urllib.error.ContentTooShortError as e: except urllib.error.ContentTooShortError as e:

2
ee/core/extract.py

@ -15,6 +15,6 @@ class EEExtract():
os.remove(file) os.remove(file)
return True return True
except tarfile.TarError as e: except tarfile.TarError as e:
Log.error(self, 'Unable to extract file \{0} {1}' Log.error(self, 'Unable to extract file \{0} {1} [FAIL]'
.format(e.errno, e.strerror)) .format(e.errno, e.strerror))
return False return False

6
ee/core/fileutils.py

@ -53,9 +53,9 @@ class EEFileUtils():
try: try:
shutil.copy2(src, dest) shutil.copy2(src, dest)
except shutil.Error as e: except shutil.Error as e:
Log.info(self, 'Error: {0}'.format(e)) Log.error(self, '{0}'.format(e))
except IOError as e: except IOError as e:
Log.info(self, 'Error: {e}'.format(e.strerror)) Log.error(self, '{e}'.format(e.strerror))
def searchreplace(self, fnm, sstr, rstr): def searchreplace(self, fnm, sstr, rstr):
try: try:
@ -63,7 +63,7 @@ class EEFileUtils():
Log.info(line.replace(sstr, rstr)) Log.info(line.replace(sstr, rstr))
fileinput.close() fileinput.close()
except Exception as e: except Exception as e:
Log.info(self, 'Error : {0}'.format(e)) Log.error(self, '{0}'.format(e))
def mvfile(self, src, dst): def mvfile(self, src, dst):
try: try:

33
ee/core/services.py

@ -17,11 +17,12 @@ class EEService():
retcode = subprocess.getstatusoutput('service {0} start' retcode = subprocess.getstatusoutput('service {0} start'
.format(service_name)) .format(service_name))
if retcode[0] == 0: if retcode[0] == 0:
Log.info(self, "Started : {0}".format(service_name)) Log.info(self, "Started : {0} [ok]"
.format(service_name))
else: else:
Log.error(self, retcode[1]) Log.error(self, retcode[1])
except OSError as e: except OSError as e:
Log.error(self, "Failed to start service {0} {1}" Log.error(self, "Failed to start service {0} {1} [FAIL]"
.format(e.errno, e.strerror)) .format(e.errno, e.strerror))
return False return False
@ -30,12 +31,13 @@ class EEService():
retcode = subprocess.getstatusoutput('service {0} stop' retcode = subprocess.getstatusoutput('service {0} stop'
.format(service_name)) .format(service_name))
if retcode[0] == 0: if retcode[0] == 0:
Log.info(self, "Stopped : {0}".format(service_name)) Log.info(self, "Stopped : {0} [OK]"
.format(service_name))
return True return True
else: else:
return False return False
except OSError as e: except OSError as e:
Log.error(self, "Failed to stop service : {0}{1}" Log.error(self, "Failed to stop service : {0}{1} [FAIL]"
.format(e.errno, e.strerror)) .format(e.errno, e.strerror))
return False return False
@ -43,8 +45,10 @@ class EEService():
try: try:
EEService.stop_service(self, service_name) EEService.stop_service(self, service_name)
EEService.start_service(self, service_name) EEService.start_service(self, service_name)
Log.info(self, "restart : {0} [OK]"
.format(service_name))
except OSError as e: except OSError as e:
Log.error(self, "Failed to restart services \{0} {1}" Log.error(self, "Failed to restart services \{0} {1} [FAIL]"
.format(e.errno, e.strerror)) .format(e.errno, e.strerror))
def reload_service(self, service_name): def reload_service(self, service_name):
@ -55,26 +59,27 @@ class EEService():
if retcode[0] == 0: if retcode[0] == 0:
subprocess.getstatusoutput('service {0} reload' subprocess.getstatusoutput('service {0} reload'
.format(service_name)) .format(service_name))
self.app.log.info("reload : {0} [OK]" Log.info("reload : {0} [OK]"
.format(service_name)) .format(service_name))
return True return True
else: else:
self.app.log.error("reload : {0} [FAIL]" Log.error("reload : {0} [FAIL]"
.format(service_name)) .format(service_name))
self.app.log.debug("{0}" Log.debug("{0}"
.format(retcode[1])) .format(retcode[1]))
return False return False
retcode = subprocess.getstatusoutput('service {0} reload' retcode = subprocess.getstatusoutput('service {0} reload'
.format(service_name)) .format(service_name))
if retcode[0] == 0: if retcode[0] == 0:
Log.info(self, "reload : {0}".format(service_name)) Log.info(self, "reload : {0} [OK]"
.format(service_name))
return True return True
else: else:
return False return False
except OSError as e: except OSError as e:
Log.error(self, "Failed to reload {0} {1}" Log.error(self, "Failed to reload {0} {1} [FAIL]"
.format(service_name, e)) .format(service_name, e))
sys.exit(1) sys.exit(1)
@ -92,6 +97,6 @@ class EEService():
else: else:
return False return False
except OSError as e: except OSError as e:
Log.error(self, "Unable to get services status \ {0}{1}" Log.error(self, "Unable to get services status \ {0}{1} [FAIL]"
.format(e.errno, e.strerror)) .format(e.errno, e.strerror))
return False return False

10
setup.py

@ -16,11 +16,11 @@ for name in glob.glob('ee/cli/templates/*.mustache'):
setup(name='ee', setup(name='ee',
version='3.0', version='3.0',
description="EasyEngine is the commandline tool to manage your Websites" description=('EasyEngine is the commandline tool to manage your Websites'
" based on WordPress and NGINX with easy to use commands.", 'based on WordPress and NGINX with easy to use commands.'),
long_description="EasyEngine is the commandline tool to manage your " long_description=('EasyEngine is the commandline tool to manage your '
"Websites based on WordPress and NGINX with easy" 'Websites based on WordPress and NGINX with easy'
" to use commands.", 'to use commands.'),
classifiers=[], classifiers=[],
keywords='', keywords='',
author='rtCamp Soultions Pvt. LTD', author='rtCamp Soultions Pvt. LTD',

Loading…
Cancel
Save