print statement replaced with print() function
This is just a minor preparation to make this work with Python3. I can remove this from this PR if you'd prefer a separate Python3 PR (note that python3 compatibility is not yet tested).
Replaced Exception.message with str(Exception). This is deprecated and actually caused an empty error message if rrdtool was not available on the system. With this change it will now show "No such file or directory".
Fixed parsing of the datafile: In my testrun with my munin-config the process broke due to lines in the datafile which contained global graph config values. This was handled in 534572c. I can currently not check if this is fixed properly as I am on a Windows box without rrdtool installed. I suggest checking this. I will give it a try once I get the chance.
Let me know what you think. I continue working on the code. I have a couple of other ideas in mind. I had trouble working on the code due to empty error messages which is handled in this PR. These 3 commits should be a good baseline of changes to continue my further work. I will await your response to see how I will continue.
The following points are in my immediate mind:
Replacing the shell script with argparse subcommands. The advantage here is that the command can be properly run in a virtual environment. Which is currently not the case. I have already finished this, but it's based on this PR and I will await your response to submit that part.
Python 3 compatibility
Better error handling. Even though the exception messages are no longer empty, it is still difficult to do development on the code-base as some exceptions are still swallowed up by an overly broad except Exception. I plan to work on this but have not decided how yet.
Unit Tests. Not sure how much I can do, but I'll give it a shot. In the worst case, this might imply a lot of refactoring. But it will make contributing to the project (and overall maintainance) much easier.
This PR changes 3 things (in 3 separate commits):
print
statement replaced withprint()
function This is just a minor preparation to make this work with Python3. I can remove this from this PR if you'd prefer a separate Python3 PR (note that python3 compatibility is not yet tested).Replaced
Exception.message
withstr(Exception)
. This is deprecated and actually caused an empty error message ifrrdtool
was not available on the system. With this change it will now show "No such file or directory".Fixed parsing of the datafile: In my testrun with my munin-config the process broke due to lines in the datafile which contained global graph config values. This was handled in 534572c. I can currently not check if this is fixed properly as I am on a Windows box without
rrdtool
installed. I suggest checking this. I will give it a try once I get the chance.Let me know what you think. I continue working on the code. I have a couple of other ideas in mind. I had trouble working on the code due to empty error messages which is handled in this PR. These 3 commits should be a good baseline of changes to continue my further work. I will await your response to see how I will continue.
The following points are in my immediate mind:
except Exception
. I plan to work on this but have not decided how yet.