My Acquia Cloud environmenthas the following domains:

  • domaindev
  • domaindev2
  • domaindev3

When I enable acquia purge on the domaindev environment, it gets all the domains of domaindev2 and domaindev3.

The reason for this is in the function acquia_purge.module:_acquia_purge_get_domains_add_acloud():

if (file_exists('/etc/apache2/conf.d')) {
    $site_name = _acquia_purge_get_site_name();
    $server_name = shell_exec("grep -r 'ServerName' /etc/apache2/conf.d/$site_name*.conf");

Specifically because the files in that folder are listed as follows:

-rw-r--r-- 1 root root 4325 2014-10-07 20:12 domaindev2-124213.conf
-rw-r--r-- 1 root root 4325 2014-09-10 18:10 domaindev3-34534.conf
-rw-r--r-- 1 root root 4291 2014-10-07 20:12 domaindev-4324.conf

Instead this code should be

if (file_exists('/etc/apache2/conf.d')) {
    $site_name = _acquia_purge_get_site_name();
    $server_name = shell_exec("grep -r 'ServerName' /etc/apache2/conf.d/$site_name-*.conf");

( add a hyphen after $site_name ).

Would love to create a patch if anyone else agrees with me that my approach is correct.

Comments

mcpuddin’s picture

Issue summary: View changes
lahoosascoots’s picture

Also an issue on 6.x

This missing dash is also causing the apache conf paths to end up in the list of domains.

matthew.lavoie’s picture

I have rolled a patch for both D6 and D7 versions with the proposed fix from the original bug report.

nielsvm’s picture

Status: Active » Closed (fixed)

@D6 - this version is lagging behind horribly and hasn't gotten much maintenance. I will do a 'worst offenders' maintenance release to it after 7.x-1.2 landed safely.

[7.x-1.x b6b7353] Issue #2352347 by matthew.lavoie, mcpuddin, lahoosascoots: Cloud Domain Detection in /etc/apache2/conf.d getting too many domains
 Author: git <git@2488890.no-reply.drupal.org>
 1 file changed, 2 insertions(+), 2 deletions(-)

Thanks folks!