Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion service/lib/dinstaller/config_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class ConfigReader
# Default DInstaller configuration which should define all the possible values
SYSTEM_PATH = "/etc/d-installer.yaml"
GIT_PATH = File.expand_path("#{__dir__}/../../etc/d-installer.yaml")
GIT_DIR = File.expand_path("#{__dir__}/../../../.git")
REMOTE_BOOT_CONFIG = "d-installer_boot.yaml"

PATHS = [
Expand All @@ -63,6 +64,7 @@ def initialize(logger: nil, workdir: "/")
def config_from_file(path = nil)
raise "Missing config file at #{path}" unless File.exist?(path)

logger.info "Reading configuration from #{path}"
Config.from_file(path)
end

Expand Down Expand Up @@ -135,7 +137,7 @@ def remote_config
end

def default_path
File.exist?(GIT_PATH) ? GIT_PATH : SYSTEM_PATH
Dir.exist?(GIT_DIR) ? GIT_PATH : SYSTEM_PATH
end

def config_paths
Expand Down