On 03/04/2010 03:28 PM, Martin Sivak wrote:
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.
Thanks, did that.
+# 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.
That's a good observation. I moved into the Job class instead, makes it
look better.
+class Job(object):
+ def run(self):
+ raise NotImplementedError()
+
+class StartJob(Job):
+class StopJob(Job):
Accidentally fixed by dealing with your previous comment.
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).
The thing is if other people actually start using it then there's no
telling if QA or somebody else won't ask for another feature or two. I
would hate to have to rewrite the bash into python like we are doing
with build scripts now. Yes, there's some pid manipulation and an
os.system() call, but it's isolated. Above that I don't think we'd
benefit much from bash and the init library.
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.
If people start using the tool I can think about a way to add this.
Or maybe a tool which generates the config file, but uses the standard initscript to start rsyslog with it.
DTTO, I can add a command to do just that.
Ales
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list