Browse Source

Ensure a properly formatted YAML file.

Joe Clarke 1 year ago
parent
commit
d704799891
1 changed files with 1 additions and 2 deletions
  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);