소스 검색

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);