Commit 50fd5ab8 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

Merge branch 'master' of ssh://bind10.isc.org/var/bind10/git/bind10

Conflicts:
	ChangeLog
parents a669db43 3552f7d2
150. [bug] jelte
b10-cfgmgr: No longer save the configuration on exit. Configuration
is already saved if it is changed succesfully, so writing it on
exit (and hence, when nothing has changed too) is unnecessary and
may even cause problems.
(Trac #435, git fd7baa38c08d54d5b5f84930c1684c436d2776dc)
149. [bug] jelte
bindctl: Check if the user session has disappeared (either by a
timeout or by a server restart), and reauthenticate if so. This
fixes the 'cmdctl not running' problem.
(trac #431, git b929be82fec5f92e115d8985552f84b4fdd385b9)
148. [func] jelte
bindctl: Command results are now pretty-printed (i.e. printed in
a more readable form). Empty results are no longer printed at all
(used to print '{}'), and the message
'send the command to cmd-ctrl' has also been removed.
(git 3954c628c13ec90722a2d8816f52a380e0065bae)
147. [bug] jinmei
python/isc/config: Fixed a bug that importing custom configuration
(in b10-config.db) of a remote module didn't work.
......
'\" t
.\" Title: bind10
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.76.0 <http://docbook.sf.net/>
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: July 29, 2010
.\" Manual: BIND10
.\" Source: BIND10
......@@ -9,15 +9,6 @@
.\"
.TH "BIND10" "8" "July 29, 2010" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
......
......@@ -61,8 +61,6 @@ def main():
except ConfigManagerDataReadError as cmdre:
print("[b10-cfgmgr] " + str(cmdre))
return 2
if cm:
return cm.write_config()
return 0
if __name__ == "__main__":
......
......@@ -58,7 +58,8 @@ class TestConfigManagerStartup(unittest.TestCase):
self.assertTrue(b.cm.read_config_called)
self.assertTrue(b.cm.notify_boss_called)
self.assertTrue(b.cm.run_called)
self.assertTrue(b.cm.write_config_called)
# if there are no changes, config is not written
self.assertFalse(b.cm.write_config_called)
self.assertTrue(b.cm.running)
b.signal_handler(None, None)
......
......@@ -169,7 +169,7 @@ main(int argc, char* argv[]) {
dlog("Server started.");
io_service.run();
} catch (const std::exception& ex) {
dlog(string("Server failed: ") + ex.what());
dlog(string("Server failed: ") + ex.what(),true);
ret = 1;
}
......
......@@ -93,7 +93,7 @@ public:
if (dnss) {
if (upstream_.empty()) {
dlog("Asked to do full recursive, but not implemented yet. "
"I'll do nothing.");
"I'll do nothing.",true);
} else {
dlog("Setting forward addresses:");
BOOST_FOREACH(const addr_t& address, upstream) {
......@@ -322,7 +322,7 @@ Resolver::~Resolver() {
delete checkin_;
delete dns_lookup_;
delete dns_answer_;
dlog("Deleting the Resolver");
dlog("Deleting the Resolver",true);
}
void
......@@ -360,7 +360,7 @@ Resolver::processMessage(const IOMessage& io_message, MessagePtr message,
return;
}
} catch (const Exception& ex) {
dlog(string("DNS packet exception: ") + ex.what());
dlog(string("DNS packet exception: ") + ex.what(),true);
server->resume(false);
return;
}
......@@ -525,7 +525,7 @@ Resolver::updateConfig(ConstElementPtr config) {
}
return (isc::config::createAnswer());
} catch (const isc::Exception& error) {
dlog(string("error in config: ") + error.what());
dlog(string("error in config: ") + error.what(),true);
return (isc::config::createAnswer(1, error.what()));
}
}
......@@ -577,13 +577,13 @@ Resolver::setListenAddresses(const vector<addr_t>& addresses) {
* If that fails, bad luck, but we are useless anyway, so just die
* and let boss start us again.
*/
dlog(string("Unable to set new address: ") + e.what());
dlog(string("Unable to set new address: ") + e.what(),true);
try {
setAddresses(dnss_, impl_->listen_);
}
catch (const exception& e2) {
dlog(string("Unable to recover from error;"));
dlog(string("Rollback failed with: ") + e2.what());
dlog(string("Unable to recover from error;"),true);
dlog(string("Rollback failed with: ") + e2.what(),true);
abort();
}
throw e; // Let it fly a little bit further
......
......@@ -24,8 +24,8 @@ namespace log {
bool denabled = false;
string dprefix;
void dlog(const string& message) {
if (denabled) {
void dlog(const string& message,bool error_flag) {
if (denabled || error_flag) {
if (!dprefix.empty()) {
cerr << "[" << dprefix << "] ";
}
......
......@@ -52,7 +52,7 @@ extern std::string dprefix;
* @param message The message to log. The real interface will probably have
* more parameters.
*/
void dlog(const std::string& message);
void dlog(const std::string& message, bool error_flag=false);
}
}
......
......@@ -26,6 +26,7 @@ import os
import copy
import tempfile
import json
import errno
from isc.cc import data
from isc.config import ccsession, config_data
......@@ -87,7 +88,12 @@ class ConfigManagerData:
else:
raise ConfigManagerDataReadError("No version information in configuration file " + config.db_filename)
except IOError as ioe:
raise ConfigManagerDataEmpty("No configuration file found")
# if IOError is 'no such file or directory', then continue
# (raise empty), otherwise fail (raise error)
if ioe.errno == errno.ENOENT:
raise ConfigManagerDataEmpty("No configuration file found")
else:
raise ConfigManagerDataReadError("Can't read configuration file: " + str(ioe))
except ValueError:
raise ConfigManagerDataReadError("Configuration file out of date or corrupt, please update or remove " + config.db_filename)
finally:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment