BIND 10 #1843: Profiles of configuration
BIND 10 Development
do-not-reply at isc.org
Tue May 1 14:00:33 UTC 2012
#1843: Profiles of configuration
-------------------------------------+-------------------------------------
Reporter: | Owner: vorner
vorner | Status: reviewing
Type: | Milestone:
enhancement | Sprint-20120501
Priority: | Resolution:
medium | Sensitive: 0
Component: bind- | Sub-Project: Core
ctl | Estimated Difficulty: 6
Keywords: | Total Hours: 0
Defect Severity: N/A |
Feature Depending on Ticket: |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Changes (by jelte):
* owner: jelte => vorner
Comment:
Replying to [comment:7 vorner]:
> Hello
>
> First, I'm not sure if the reverting is something we want to do, because
it may lead to quite some confusion. Imagine:
> * The list of commands sets something, commits, then sets something
else and fails. It reverts to the pre-commit state.
> * The list of commands contains some commands to the running
components. They are executed up to the failure point, but the
configuration is reverted.
>
> Considering it is possible to call `config revert` manually, I think it
is better to just output a nice fat warning.
>
yeah, i was kinda thinking maybe it should reset stuff on its own at the
start and revert that, but it is all mostly unexpected intelligence and
trying to be too smart :p
replaced revert with warning giving some advice
> Also, there are few nits in the code.
>
> This can be simplified:
> {{{#!python
> try:
> command_file = open(command.params['filename'])
> # copy them into a list for consistency with the built-
in
> # sets of commands
> commands = []
> for line in command_file:
> commands.append(line)
> command_file.close()
> }}}
> to:
> {{{#!python
> try:
> commands = open(command.params['filename']).readlines()
> }}}
>
> (note that if there are no other references to the file, it should get
destroyed right away by dropping the refcount to 0 and therefore get
closed automatically)
>
actually, the 'right' way to do it in python is to use with, so i changed
it to
{{{
with open(command.params['filename']) as command_file:
commands = command_file.readlines()
}}}
> This is whitespace intolerant ‒ if you place two spaces or tab before
the on/off, it fails. The reason is hard to see then:
> {{{#!python
> elif line.startswith('!verbose on'):
> verbose = True
> elif line.startswith('!verbose off'):
> verbose = False
> }}}
>
ack. Used some simply regexps now. Made them case-insensitive while i was
at it :)
> This comment seems to end prematurely:
> {{{
> # This file provides a built-in set of 'execute' commands, for common
> # functions, such as adding an initial auth server
> # These sets must have an associated CommandInfo defined in
> # bindctl_main.py.in, in prepare_execute_commands, and
> # a handler in
> }}}
It was also dated (I later moved all creation into this file so you don't
have to edit 3 files to add one command set)
Updated comment, and added one for the command_sets structure.
>
> Missing `n` in:
> {{{
> # This would fail if the entire list was passed, or the configuratio
> }}}
>
fixed
> And there's an extra newline at the end of the lettuce test file.
>
fixed
> Besides, this reminds me of intercal:
> {{{
> last bindctl output should contain Please
> }}}
> Should we change the line to „The output should be polite“? ;-P
heh :) It was the most unique word in the output. Yes we could make a
fixed lettuce step for that :)
--
Ticket URL: <http://bind10.isc.org/ticket/1843#comment:8>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list