1+ using Downloads
12
23abstract type Localhost <: OnPremises end
34
@@ -17,32 +18,31 @@ function readCCConfig(config_file::String)
1718 close (io)
1819 contents
1920 catch
20- default_location = " /etc/ $config_file "
21+ # system wide location
2122 try
22- # defaul system location
23+ default_location = " /etc/ $config_file "
2324 io = open (default_location)
2425 contents = read (io,String)
2526 close (io)
2627 contents
2728 catch
28- @info " The configuration file ($config_file ) was not found."
29-
30- # dpf_path = @get_scratch!("default_platform_path")
31- # dpf_url = "https://raw.githubusercontent.com/PlatformAwareProgramming/PlatformAware.jl/manager/src/features/default/Platform.toml"
32- # dpf_fname = joinpath(dpf_path, basename(dpf_url))
33- # try_download(dpf_url, dpf_fname)
34-
35- # read(dpf_fname,String)
29+ # NOTHING TO DO
3630 end
3731 end
3832
3933 # @info "=====> $ccconfig_toml"
4034 if isnothing (ccconfig_toml)
41- @error " The configuration file ($config_file ) was not found."
42- return nothing
35+ @warn " A configuration file ($config_file ) was not found. A default $config_file will be downloaded and copied to the current directory."
36+ fetch_default_configuration_file (config_file)
37+ return readCCConfig (config_file)
38+ else
39+ return TOML. parse (ccconfig_toml)
4340 end
41+ end
4442
45- TOML. parse (ccconfig_toml)
43+ function fetch_default_configuration_file (config_file)
44+ url = " https://raw.githubusercontent.com/PlatformAwareProgramming/CloudClusters.jl/refs/heads/main/CCconfig.toml"
45+ Downloads. download (url, config_file)
4646end
4747
4848function loadDefaults (_:: Type{Provider} , ccconfig_dict)
0 commit comments