@@ -50,31 +50,13 @@ load(Proplist) when is_list(Proplist) ->
5050 case pget (local_path , Proplist , undefined ) of
5151 undefined -> {error , " local definition file path is not configured: local_path is not set" };
5252 Path ->
53- <<<<<<< HEAD
54- rabbit_log :debug (" Asked to import definitions from a local file or directory at '~s '" , [Path ]),
55- case file :read_file_info (Path , [raw ]) of
56- {ok , FileInfo } ->
57- % % same check is used by Cuttlefish validation, this is to be extra defensive
58- IsReadable = (element (4 , FileInfo ) == read ) or (element (4 , FileInfo ) == read_write ),
59- case IsReadable of
60- true ->
61- load_from_single_file (Path );
62- false ->
63- Msg = rabbit_misc :format (" local definition file '~s ' does not exist or cannot be read by the node" , [Path ]),
64- {error , Msg }
65- end ;
66- _ ->
67- Msg = rabbit_misc :format (" local definition file '~s ' does not exist or cannot be read by the node" , [Path ]),
68- {error , {could_not_read_defs , Msg }}
69- =======
7053 rabbit_log :debug (" Asked to import definitions from a local file or directory at '~ts '" , [Path ]),
7154 IsDir = filelib :is_dir (Path ),
7255 case IsDir of
7356 true ->
7457 load_from_local_path (true , Path );
7558 false ->
7659 load_from_single_file (Path )
77- >>>>>>> 975 dced74c (Closes #7685 )
7860 end
7961 end ;
8062load (Map ) when is_map (Map ) ->
@@ -217,16 +199,6 @@ load_from_multiple_files([File|Rest]) ->
217199 end .
218200
219201load_from_single_file (Path ) ->
220- <<<<<<< HEAD
221- rabbit_log :debug (" Will try to load definitions from a local file or directory at '~s '" , [Path ]),
222- case rabbit_misc :raw_read_file (Path ) of
223- {ok , Body } ->
224- rabbit_log :info (" Applying definitions from file at '~s '" , [Path ]),
225- import_raw (Body );
226- {error , E } ->
227- rabbit_log :error (" Could not read definitions from file at '~s ', error: ~p " , [Path , E ]),
228- {error , {could_not_read_defs , {Path , E }}}
229- =======
230202 rabbit_log :debug (" Will try to load definitions from a local file or directory at '~ts '" , [Path ]),
231203
232204 case file :read_file_info (Path , [raw ]) of
@@ -250,5 +222,4 @@ load_from_single_file(Path) ->
250222 _ ->
251223 Msg = rabbit_misc :format (" local definition file '~ts ' does not exist or cannot be read by the node" , [Path ]),
252224 {error , {could_not_read_defs , Msg }}
253- >>>>>>> 975 dced74c (Closes #7685 )
254225 end .
0 commit comments