[bind10-dev] _check_item_spec behavior
Jelte Jansen
jelte at isc.org
Tue Oct 19 08:37:57 UTC 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10/19/2010 01:49 AM, Jeremy C. Reed wrote:
> isc.config.module_spec's _check_item_spec checks that the specification
> for a configuration data has item_optional and item_default.
>
> Is it really necessary to fail if these don't exist? Okay if they just
> default to None?
>
i guess we could make them optional in the specification parser, but if there is
no mandatory item_default we'd need default defaults for the cpp side (0 for
int, "" for string, etc) on the python side we could make it None, but then
again, we might want to keep them identical :)
> It "Raises a ModuleSpecError if there is an error" (like missing
> item_type). This causes a python Traceback output that is many lines
> long (over a screen full) which hides the error message. I think this
> should be more friendly.
>
> I understand that the spec files should be maintained by a BIND 10 tool,
> but possibly they could have mistakes due to personal tools or manual
> editing.
>
actually, these should be maintained by hand. These are specification of
modules, i.e. on par with their source code
> If the specification is actually corrupted, there is a "JSON parse
> error" but still many lines of Traceback output that may cause admin to
> overlook the actual problem,
errors in the spec file should be seen as programming errors, admins should
never ever edit these files. We could look into shortening them (i.e. trying to
catch them on a somewhat higher level, and raising another exception with its
contents), but in general I prefer too much information over too little for
code-level errors
Jelte
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAky9WOUACgkQ4nZCKsdOncX1BQCgqZLxV+pKpx9zoe4odB6kt2xR
t88AniGgs+V/f2sf9PIO0rdrroguP9C1
=z1Y6
-----END PGP SIGNATURE-----
More information about the bind10-dev
mailing list