feat: Update 2 files
This commit is contained in:
@@ -160,7 +160,7 @@ namespace dropshell
|
|||||||
std::string template_info_env_file = localfile::template_info_env(server_name,service_name);
|
std::string template_info_env_file = localfile::template_info_env(server_name,service_name);
|
||||||
ASSERT(std::filesystem::exists(template_info_env_file), "Template info env file not found: " + template_info_env_file);
|
ASSERT(std::filesystem::exists(template_info_env_file), "Template info env file not found: " + template_info_env_file);
|
||||||
std::ofstream template_info_env_file_out(template_info_env_file, std::ios::app); // append to the file.
|
std::ofstream template_info_env_file_out(template_info_env_file, std::ios::app); // append to the file.
|
||||||
template_info_env_file_out << "TEMPLATE_HASH=" << tinfo.hash() << std::endl;
|
template_info_env_file_out << std::endl << "TEMPLATE_HASH=" << tinfo.hash() << std::endl;
|
||||||
template_info_env_file_out.close();
|
template_info_env_file_out.close();
|
||||||
|
|
||||||
|
|
||||||
@@ -267,7 +267,7 @@ namespace dropshell
|
|||||||
// append TEMPLATE_HASH to the .template_info.env file
|
// append TEMPLATE_HASH to the .template_info.env file
|
||||||
ASSERT(std::filesystem::exists(target_template_info_env_file), "Template info env file not found: " + target_template_info_env_file);
|
ASSERT(std::filesystem::exists(target_template_info_env_file), "Template info env file not found: " + target_template_info_env_file);
|
||||||
std::ofstream template_info_env_file_out(target_template_info_env_file, std::ios::app); // append to the file.
|
std::ofstream template_info_env_file_out(target_template_info_env_file, std::ios::app); // append to the file.
|
||||||
template_info_env_file_out << "TEMPLATE_HASH=" << tinfo.hash() << std::endl;
|
template_info_env_file_out << std::endl << "TEMPLATE_HASH=" << tinfo.hash() << std::endl;
|
||||||
template_info_env_file_out.close();
|
template_info_env_file_out.close();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -142,7 +142,11 @@ namespace dropshell
|
|||||||
service.service_template_hash_match = false;
|
service.service_template_hash_match = false;
|
||||||
|
|
||||||
if (it == variables.end())
|
if (it == variables.end())
|
||||||
error << "Variable TEMPLATE_HASH not found in the service " << filenames::template_info_env << " for "<<server_name << " - "<< service.template_name << std::endl;
|
{
|
||||||
|
// For backward compatibility with services created before hash mechanism
|
||||||
|
debug << "TEMPLATE_HASH not found in " << filenames::template_info_env << " for " << server_name << " - " << service.template_name
|
||||||
|
<< " (service may have been created before hash tracking was implemented)" << std::endl;
|
||||||
|
}
|
||||||
else if (tinfo.is_set())
|
else if (tinfo.is_set())
|
||||||
{
|
{
|
||||||
std::string template_hash_str = it->second;
|
std::string template_hash_str = it->second;
|
||||||
|
Reference in New Issue
Block a user