Commit ca84c49a authored by Jon Pugh's avatar Jon Pugh Committed by helmo

Move parent::write() to the end of the function to the code in write() actually has an effect.

parent aa9080d5
...@@ -14,8 +14,6 @@ class Provision_Config_Http_Ssl_Site extends Provision_Config_Http_Site { ...@@ -14,8 +14,6 @@ class Provision_Config_Http_Ssl_Site extends Provision_Config_Http_Site {
public $description = 'encrypted virtual host configuration'; public $description = 'encrypted virtual host configuration';
function write() { function write() {
parent::write();
if ($this->ssl_enabled && $this->ssl_key) { if ($this->ssl_enabled && $this->ssl_key) {
$path = dirname($this->data['ssl_cert']); $path = dirname($this->data['ssl_cert']);
// Make sure the ssl.d directory in the server ssl.d exists. // Make sure the ssl.d directory in the server ssl.d exists.
...@@ -50,6 +48,7 @@ class Provision_Config_Http_Ssl_Site extends Provision_Config_Http_Site { ...@@ -50,6 +48,7 @@ class Provision_Config_Http_Ssl_Site extends Provision_Config_Http_Site {
// If cert is not ok, turn off ssl_redirection. // If cert is not ok, turn off ssl_redirection.
if ($this->ssl_cert_ok == FALSE) { if ($this->ssl_cert_ok == FALSE) {
$this->data['ssl_redirection'] = FALSE; $this->data['ssl_redirection'] = FALSE;
drush_log(dt('SSL Certificate preparation failed. SSL has been disabled for this site.'), 'warning');
} }
// Sync the key directory to the remote server. // Sync the key directory to the remote server.
...@@ -57,6 +56,10 @@ class Provision_Config_Http_Ssl_Site extends Provision_Config_Http_Site { ...@@ -57,6 +56,10 @@ class Provision_Config_Http_Ssl_Site extends Provision_Config_Http_Site {
'exclude' => "{$path}/*.receipt", // Don't need to synch the receipts 'exclude' => "{$path}/*.receipt", // Don't need to synch the receipts
)); ));
} }
// Call parent's write AFTER ensuring the certificates are in place to prevent
// the vhost from referencing missing files.
parent::write();
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment