瀏覽代碼

Ensure a properly formatted YAML file.

Joe Clarke 1 年之前
父節點
當前提交
d704799891
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      www/export_deadman.php

+ 1 - 2
www/export_deadman.php

@@ -186,6 +186,7 @@ $targets['targets']['infra'] = $new_infra;
 
 try {
     $yaml = yaml_emit($targets, YAML_UTF8_ENCODING, YAML_LN_BREAK);
+    $yaml = preg_replace('/^---/', '', $yaml);
 } catch (Exception $e) {
     $msg = "Failed to generate YAML: '{$e->getMessage()}'";
     if ($is_script) {
@@ -215,8 +216,6 @@ try {
 # If the target doesn't have a v4 or v6, then the target will be looked
 # up by hostname and one v4 and one v6 address will be added to the config.
 ###
-
-
 HEADER;
 
     fwrite($fd, $header);