wordpress-charmers team mailing list archive
-
wordpress-charmers team
-
Mailing list archive
-
Message #00238
[Merge] ~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress:return-immediately into charm-k8s-wordpress:master
Tom Haddon has proposed merging ~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress:return-immediately into charm-k8s-wordpress:master.
Commit message:
Switch the 'return' pattern in is_vhost_ready to match wordpress_configured
Requested reviews:
Wordpress Charmers (wordpress-charmers)
For more details, see:
https://code.launchpad.net/~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress/+merge/383285
Switch the 'return' pattern in is_vhost_ready to match wordpress_configured
--
Your team Wordpress Charmers is requested to review the proposed merge of ~mthaddon/charm-k8s-wordpress/+git/charm-k8s-wordpress:return-immediately into charm-k8s-wordpress:master.
diff --git a/mod/operator b/mod/operator
index 60c43f8..11a1849 160000
--- a/mod/operator
+++ b/mod/operator
@@ -1 +1 @@
-Subproject commit 60c43f81e36139ab4044c185247eb27fe389bce6
+Subproject commit 11a1849205d750e28aaa4a13938b5864659f928b
diff --git a/src/wordpress.py b/src/wordpress.py
index 137ea00..6da3e69 100644
--- a/src/wordpress.py
+++ b/src/wordpress.py
@@ -118,18 +118,17 @@ class Wordpress:
"""Check whether wordpress is available using http."""
requests = import_requests()
- rv = True
# Check if we have WP code deployed at all
try:
r = self.call_wordpress(service_ip, "/wp-login.php", redirects=False)
if r is None:
logger.error("call_wordpress() returned None")
- rv = False
+ return False
if hasattr(r, "status_code") and r.status_code in (403, 404):
logger.info("Wordpress returned an unexpected status {}".format(r.status_code))
- rv = False
+ return False
except requests.exceptions.ConnectionError:
logger.info("HTTP vhost is not ready yet")
- rv = False
+ return False
- return rv
+ return True
Follow ups