Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
VyOSError is now only raised on improper config operations and internal errors,
such as trying to use a function on a wrong kind of node.
ConfigError should be used by scripts to indicate configuration mistakes
and error conditions.
|
|
shemminger once said we already overuse sudo and advocated using capabilities
instead, but I think the union of all privilege sets needed equals the root
privileges, and in practice admin level users need sudo anyway.
|
|
Check if crontab exists before trying to delete it. Fail commit if
executable is not defined in the task.
|
|
|
|
Do not inherit from the Config class, it only made things more complicated.
Remove the sys.path.append that was made necessary by using partial paths where full
paths are expected.
Exit with 1 (to make commit fail properly) if VyOSError is raised.
Replace the OO representation of cron jobs with simple hashes: the format is not expected
to grow any more complex and encapsulation will hardly be necessary (though if one can think of
a good OO design for this, it's welcome).
Do not mix config reading and validation to enable changing the syntax without changing any of the
code but get_config()
|
|
like their Perl counterparts.
Most scripts used to do something like
my $foo = $config->returnValue("system foo");
if !defined($foo) {
$foo = $defaultFooValue;
}
In most cases values do not exist because they are optional and simply not set.
In a substantial minority of cases they don't exist but are mandatory, in this case
it's probably a good practice to check if it exists first.
In rare but frustrating cases returnValue returns undef because the path is wrong.
It was tempting but as it turns out impractical to force the user to handle every undefined
value as an error, but the cost of wrapping every return_value call in a try/except block
is too high.
Instead we should facilitate the most common case. For this, those functions now support
an optional named argument default=None so an optional value with a sensible default can be
handled like
$foo = config.return_value("system foo", default="bar")
|
|
to avoid having to decode it anywhere else.
|
|
Ugly fixup in the makefile to delete generated node.def's that are now in other packages.
Adjust the cron interface definition to better match the old templates.
|
|
|
|
makefiles.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|