fix indentation and wp-cli path

This commit is contained in:
VirtuBox
2019-03-04 07:12:57 +01:00
parent 188b91df74
commit 34401eefe6
5 changed files with 51 additions and 52 deletions

View File

@@ -588,7 +588,7 @@ function wo_update_latest()
# Fix for 3.3.2 renamed nginx.conf
nginx -V 2>&1 &>>/dev/null
nginx -V &>>/dev/null 2>&1
if [[ $? -eq 0 ]]; then
nginx -t 2>&1 | grep 'open() "/etc/nginx/nginx.conf" failed' &>>/dev/null
if [[ $? -eq 0 ]]; then

View File

@@ -100,7 +100,6 @@ def setupdomain(self, data):
raise SiteError("created nginx configuration failed for site."
" check with `nginx -t`")
# create symbolic link for
WOFileUtils.create_symlink(self, ['/etc/nginx/sites-available/{0}'
.format(wo_domain_name),
@@ -385,7 +384,6 @@ def setupwordpress(self, data):
.format(os.getcwd()+'/wp-config.php', os.path.abspath(os.path.join(os.getcwd(), os.pardir))), False)
raise SiteError("Unable to move wp-config.php")
if not wo_wp_user:
wo_wp_user = WOVariables.wo_user
while not wo_wp_user:
@@ -577,6 +575,7 @@ def uninstallwp_plugin(self, plugin_name, data):
except CommandExecutionError as e:
raise SiteError("plugin uninstall failed")
def setupwp_plugin(self, plugin_name, plugin_option, plugin_data, data):
wo_site_webroot = data['webroot']
Log.info(self, "Setting plugin {0}, please wait..."
@@ -741,7 +740,7 @@ def site_package_check(self, stype):
"releases/download/v{0}/"
"wp-cli-{0}.phar"
.format(WOVariables.wo_wp_cli),
"/usr/bin/wp", "WP-CLI"]]
"/usr/local/bin/wp", "WP-CLI"]]
if self.app.pargs.wpredis:
Log.debug(self, "Setting apt_packages variable for redis")
if not WOAptGet.is_installed(self, 'redis-server'):

View File

@@ -1476,7 +1476,7 @@ class WOStackController(CementBaseController):
"releases/download/v{0}/"
"wp-cli-{0}.phar"
"".format(WOVariables.wo_wp_cli),
"/usr/bin/wp",
"/usr/local/bin/wp",
"WP-CLI"]]
else:
Log.debug(self, "WP-CLI is already installed")
@@ -1686,8 +1686,8 @@ class WOStackController(CementBaseController):
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']
if os.path.isfile('/usr/local/bin/wp'):
packages = packages + ['/usr/local/bin/wp']
else:
Log.warn(self, "WP-CLI is not installed with WordOps")
if self.app.pargs.phpmyadmin:
@@ -1824,8 +1824,8 @@ class WOStackController(CementBaseController):
apt_packages = apt_packages + WOVariables.wo_hhvm
Log.debug(self, "Purge package variable WPCLI")
if os.path.isfile('/usr/bin/wp'):
packages = packages + ['/usr/bin/wp']
if os.path.isfile('/usr/local/bin/wp'):
packages = packages + ['/usr/local/bin/wp']
else:
Log.warn(self, "WP-CLI is not installed with WordOps")
if self.app.pargs.phpmyadmin:

View File

@@ -137,12 +137,12 @@ class WOStackUpgradeController(CementBaseController):
Log.info(self, "Redis is not installed")
if self.app.pargs.wpcli:
if os.path.isfile('/usr/bin/wp'):
if os.path.isfile('/usr/local/bin/wp'):
packages = packages + [["https://github.com/wp-cli/wp-cli/"
"releases/download/v{0}/"
"wp-cli-{0}.phar"
"".format(WOVariables.wo_wp_cli),
"/usr/bin/wp",
"/usr/local/bin/wp",
"WP-CLI"]]
else:
Log.info(self, "WPCLI is not installed with WordOps")