summaryrefslogtreecommitdiffstats
path: root/provision.inc
diff options
context:
space:
mode:
authorJon Pugh2016-11-10 21:38:50 (GMT)
committerJon Pugh2016-11-10 21:38:50 (GMT)
commit07e9a9185ff2e0501ef16a292c7738d11b8a3e42 (patch)
tree0ec68d5ffd4ea727faa6222814d7945546ee9d2a /provision.inc
parente39364bab4345d78322f14ddbd4cb84747dd9970 (diff)
Issue #2826388: Move logic to a new function: provision_is_hostmaster_site().2826388-check-hostmaster
Diffstat (limited to 'provision.inc')
-rw-r--r--provision.inc11
1 files changed, 11 insertions, 0 deletions
diff --git a/provision.inc b/provision.inc
index 2c558fc..fe9c73f 100644
--- a/provision.inc
+++ b/provision.inc
@@ -132,6 +132,17 @@ function provision_is_local_host($host) {
}
/**
+ * Determine if the currently acting context is the server's hostmaster site.
+ *
+ * @return
+ * Boolean TRUE if the current drush context is "@hostmaster".
+ */
+function provision_is_hostmaster_site() {
+ // If the current root and URI matches "@hostmaster" root and URI, this is hostmaster.
+ return d()->root == d('@hostmaster')->root && d()->uri == d('@hostmaster')->uri;
+}
+
+/**
* return the FQDN of the machine or provided host
*
* this replicates hostname -f, which is not portable