FIx nuke
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled

This commit is contained in:
Your Name
2025-05-17 18:55:14 +12:00
parent 5bf93dc954
commit 203068048d
3 changed files with 41 additions and 27 deletions

View File

@ -6,6 +6,7 @@
#include "utils/utils.hpp"
#include "server_env_manager.hpp"
#include "servers.hpp"
#include "assert.hpp"
#include <iostream>
#include <filesystem>
@ -68,6 +69,12 @@ LocalServiceInfo get_service_info(const std::string &server_name, const std::str
if (service.local_service_path.empty())
return LocalServiceInfo();
// check the service directory exists.
if (!fs::exists(service.local_service_path))
{
std::cerr << "Error: Service directory not found: " << service.local_service_path << std::endl;
return LocalServiceInfo();
}
// now set the template name and path.
std::map<std::string, std::string> variables;
@ -221,7 +228,7 @@ bool get_all_service_env_vars(const std::string &server_name, const std::string
if (localpath::service(server_name, service_name).empty() || !fs::exists(localpath::service(server_name, service_name)))
{
std::cerr << "Error: Service not found: " << service_name << std::endl;
std::cerr << "Error: Service not found: " << service_name << " on server " << server_name << std::endl;
return false;
}
@ -229,7 +236,6 @@ bool get_all_service_env_vars(const std::string &server_name, const std::string
if (server_info.ssh_host.empty())
std::cerr << "Error: Server " << server_name << " not found - ssh_host empty, so HOST_NAME not set" << std::endl;
// add in some handy variables.
// if we change these, we also need to update agent/_allservicesstatus.sh
all_env_vars["CONFIG_PATH"] = remotepath::service_config(server_name,service_name);