Commit 02ed9516 authored by anarcat's avatar anarcat Committed by anarcat

move from provision_log/set_error to drush_log/set_error

parent 648288fa
......@@ -15,7 +15,7 @@ function provision_dns_provision_pre_install(&$data, $url = NULL) {
if ($url) {
# $url_parts = _provision_dns_split_url($url);
# if (!isset($url_parts['zone'])) {
provision_set_error(PROVISION_FRAMEWORK_ERROR);
drush_set_error(PROVISION_FRAMEWORK_ERROR);
return;
# }
......
......@@ -75,8 +75,8 @@ function provision_bind_create_zone_config($zone) {
$fd = fwrite($fd, $zone_str);
}
if (!$fd) {
provision_log("Error", t("error adding the zone to the bind configuration in @path", array("@path" => $conf)));
provision_set_error(PROVISION_PERM_ERROR);
drush_log("Error", dt("error adding the zone to the bind configuration in @path", array("@path" => $conf)));
drush_set_error(PROVISION_PERM_ERROR);
}
@fclose($fd);
}
......@@ -123,18 +123,18 @@ function provision_bind_update_zone($zone, $exists = FALSE) {
$conf = PROVISION_CONFIG_PATH . '/' . variable_get('provision_bind_conf', 'named.conf.drupal');
if ($exists && isset($zone->old_origin)) { # The name of the zone has changed
#provision_log("notice", "Updating zone ".$zone->old_origin." to ".$zone->origin);
#drush_log("notice", "Updating zone ".$zone->old_origin." to ".$zone->origin);
provision_path("unlink", $path . '/' . $zone->old_origin); # Remove the old zonefile
_provision_bind_editfile($conf, '^zone..'.$zone->old_origin.'.*$'); # Remove the old zone from named.conf
provision_bind_create_zone_config($zone); # And re-create the zone in named.conf
}
#provision_log("notice", "Writing zonefile: ".$zone_str);
#drush_log("notice", "Writing zonefile: ".$zone_str);
if ($fd = fopen($path . '/'. $zone->origin, "w")) {
fwrite($fd, $zone_str); # Write the zonefile
fclose($fd);
} else {
provision_set_error(PROVISION_PERM_ERROR);
drush_set_error(PROVISION_PERM_ERROR);
}
}
......@@ -179,7 +179,7 @@ function _provision_bind_add_record($zone, $record) {
fwrite($fh, $line);
fclose($fh);
} else {
provision_set_error(PROVISION_PERM_ERROR);
drush_set_error(PROVISION_PERM_ERROR);
}
}
......@@ -279,12 +279,12 @@ function _provision_bind_editfile($file, $old, $new = '') {
}
fclose($fd);
} else {
provision_set_error(PROVISION_PERM_ERROR);
drush_set_error(PROVISION_PERM_ERROR);
}
# Write out the changed lines to the original file again.
if (!file_put_contents($file, $lines)) {
provision_set_error(PROVISION_PERM_ERROR);
drush_set_error(PROVISION_PERM_ERROR);
}
}
......
......@@ -30,10 +30,10 @@ function provision_dns_create_zone($domain, $data) {
PROVISION_PERM_ERROR | PROVISION_FRAMEWORK_ERROR);
# if ($zone = provision_dns_status('zone', array('domain' => $domain))) {
# provision_log("Notice", t("Loading zone file for url @url", array('@url' => $domain)));
# drush_log("Notice", t("Loading zone file for url @url", array('@url' => $domain)));
# return $zone;
# } else {
provision_log("Notice", t("Generating zone file for url @url on dns server @id", array('@url' => $domain, '@id' => $data['dns_id'])));
drush_log("Notice", dt("Generating zone file for url @url on dns server @id", array('@url' => $domain, '@id' => $data['dns_id'])));
# Setup args array from defaults
$dns = node_load($data['dns_id']);
$zone_fields['dns_id'] = $data['dns_id'];
......@@ -41,7 +41,7 @@ function provision_dns_create_zone($domain, $data) {
$zone_fields['serial'] = date('Ymd') . '01';
$ns_recs = explode("\n", $dns->ns);
#ob_start(); print_r($ns_recs); $out = ob_get_contents(); ob_end_clean();
provision_log("notice", "provision_dns_create_zone ns_recs: ".$ns_recs[0].", ".$ns_recs[1]);
drush_log("notice", "provision_dns_create_zone ns_recs: ".$ns_recs[0].", ".$ns_recs[1]);
$zone_fields['ns1'] = $ns_recs[0];
$zone_fields['ns2'] = $ns_recs[1];
$zone_fields['mbox'] = $dns->mbox;
......
......@@ -22,10 +22,10 @@ function provision_dns_provision_verify(&$data, $url = NULL) {
# t('Changed group ownership of '.PROVISION_NAMED_PATH.' to @confirm'),
# t('Could not change group ownership of '.PROVISION_NAMED_PATH.' to @confirm'));
} else {
provision_log("notice", "Hit provision_dns_provision_verify hook: $url");
drush_log("notice", "Hit provision_dns_provision_verify hook: $url");
# $url_parts = _provision_dns_split_url($url);
if (!isset($url_parts['zone'])) {
provision_set_error(PROVISION_FRAMEWORK_ERROR);
drush_set_error(PROVISION_FRAMEWORK_ERROR);
return;
}
......
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