Re: [master] analog, a script to receive logs from a remote install.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> +class OptParserError(Exception):
> +    def __init__(self, msg, parser):
> +        Exception.__init__(self, msg, parser)
> +        self.msg = msg
> +        self.parser = parser
> +
> +class AnalogError(Exception):
> +    def __init__(self, msg):
> +        Exception.__init__(self, msg)
> +        self.msg = msg

Exception class already takes care of the attributes, so you only need to write:

class AnalogError(Exception):
    pass

And then use:

except Exception as exc:
  print str(exc)

If you need more arguments override the __str__ method in OptParseError and access self.args to construct the new string.

> +# helper functions
> +def get_pid(analog_dir, jobname):

If you want to be clear enough as with the Job abstraction, then why not use get_rsyslogd_pid().
Also why didn't you include the function into the Analog class? It seems related to it.


> +class Job(object):
> +    def run(self):
> +        raise NotImplementedError()
> +        
> +class StartJob(Job):
> +class StopJob(Job):

Were this a importable library, I wouldn't care, but isn't this a little bit of overengineering for "simple" script in /usr/bin?

And my last comment...

This looks like standard initscript, so my first language of choice for it would be bash, because all the pid retrieval functions, start and stop helpers and other tools are standard part of Fedora initscripts (/etc/init.d/functions).

Also I can imagine situation when somebody may want to receive all the install logs to a dedicated logging machine (as is often the case with logs from production machines) so just a config template or initscript which logs the IP of log's source would be a better fit.

Or maybe a tool which generates the config file, but uses the standard initscript to start rsyslog with it.

Martin

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux