diff --git a/src/chef-server-ctl/bin/chef-server-ctl b/src/chef-server-ctl/bin/chef-server-ctl index 51b1a64983..bb620e97c7 100755 --- a/src/chef-server-ctl/bin/chef-server-ctl +++ b/src/chef-server-ctl/bin/chef-server-ctl @@ -6,6 +6,8 @@ require 'veil' require 'chef_server_ctl/log' require 'chef_server_ctl/config' require "license_acceptance/acceptor" +#require "chef-config/dist" +#require "chef" module Omnibus # This implements callbacks for handling commands related to the @@ -28,13 +30,13 @@ module Omnibus d end - CREDENTIAL_ENV = 'CHEF_SECRETS_DATA'.freeze + CREDENTIAL_ENV = "#{ChefUtils::Dist::Infra::SHORT.upcase}_SECRETS_DATA".freeze def credentials if ENV.has_key?(CREDENTIAL_ENV) @credentials = Veil::CredentialCollection::ChefSecretsEnv.new(var_name: CREDENTIAL_ENV) else - secrets_file = ENV['SECRETS_FILE'] || "/etc/opscode/private-chef-secrets.json" + secrets_file = ENV['SECRETS_FILE'] || "/etc/opscode/private-#{ChefUtils::Dist::Infra::SHORT}-secrets.json" @credentials ||= Veil::CredentialCollection::ChefSecretsFile.from_file(secrets_file) end end @@ -75,13 +77,13 @@ module Omnibus last = exec_list.shift connection.exec(last) end - puts "Chef Server databases and roles have been successsfully deleted from #{postgres['vip']}" + puts "#{ChefUtils::Dist::Server::PRODUCT} databases and roles have been successfully deleted from #{postgres['vip']}" rescue StandardError => e exec_list.insert(0, last) unless last.nil? if exec_list.empty? path = nil else - path = Time.now.strftime('/root/%FT%R-chef-server-manual-postgresql-cleanup.sql') + path = Time.now.strftime("/root/%FT%R-#{ChefConfig::Dist::SHORT}-server-manual-postgresql-cleanup.sql") dump_exec_list_to_file(path, exec_list) end # Note - we're just showing the error and not exiting, so that @@ -157,15 +159,15 @@ STAT001: An error occurred while attempting to get status from PostgreSQL #{format_multiline_message(12, message)} - See https://docs.chef.io/error_messages.html#stat001-postgres-failed + See #{ChefUtils::Dist::Server::DOCS}/error_messages.html#stat001-postgres-failed for more information. EOM end def err_CLEANSE001_postgres_failed(postgres, path, last, message) msg = <