I tried to run the following command lines to create a zone and add some records to them:

drush @server_master provision-zone create foobar.com
drush @server_master provision-zone rr-add foobar.com www A 1.2.3.4

The zone gets created. But the rr-add command throws an error at line 44 of dns.drush.inc

With the following change the record is added correctly.

    $record = d()->service('dns')->config('zone', $zone)->record_get($name);
    if (!is_array($record[$type])) {
      $record[$type] = array();
    }
    $record[$type] = array_merge($record[$type], array($destination));

It seems that $record is not initialized the first time a zone gets created through drush.

Comments

anarcat’s picture

Status: Active » Fixed

Fix committed, thanks. In the future, please provide a proper patch and mark the issue as "needs review", see also http://drupal.org/patch/create

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 6212c40 on prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by anarcat:
    #1053834 - silence a warning in dns rr-add