From f1ef57e0b53cf5fdf5f9e79f67e828db7c433f2b Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 30 Aug 2010 22:25:59 +0200 Subject: [PATCH] A $ONE_LOCATION/var/config file is written with the configuration being used by the OpenNebula daemon. The file is written in plain txt format. --- src/nebula/Nebula.cc | 14 +++++++++++--- src/template/Template.cc | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/nebula/Nebula.cc b/src/nebula/Nebula.cc index 61c0622404..82ad1f3b2a 100644 --- a/src/nebula/Nebula.cc +++ b/src/nebula/Nebula.cc @@ -64,6 +64,15 @@ void Nebula::start() throw runtime_error("Could not load nebula configuration file."); } + string config_fname = log_location + "config"; + ofstream config_file(config_fname.c_str(), ios_base::trunc & ios_base::out); + + if (config_file.fail() == false) + { + config_file << *nebula_configuration << endl; + config_file.close(); + } + // ----------------------------------------------------------- // Log system // ----------------------------------------------------------- @@ -109,10 +118,9 @@ void Nebula::start() NebulaLog::log("ONE",Log::INFO,"----------------------------------------"); os.str(""); - - os << "\n--------------------------------------------"; + os << "\n----------------------------------\n"; os << *nebula_configuration; - os << "\n--------------------------------------------"; + os << "----------------------------------"; NebulaLog::log("ONE",Log::INFO,os); diff --git a/src/template/Template.cc b/src/template/Template.cc index 0da76c8965..8556237ed4 100644 --- a/src/template/Template.cc +++ b/src/template/Template.cc @@ -367,7 +367,7 @@ string& Template::to_str(string& str) const { s = it->second->marshall(","); - os << endl << "\t" << it->first << separator << *s; + os << it->first << separator << *s << endl; delete s; }