Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

fix rrdtool 1.5.x compatibility #13

Merged
merged 1 commit into from
Sep 26, 2016
Merged

Conversation

Arvedui
Copy link
Contributor

@Arvedui Arvedui commented Sep 7, 2016

in version 1.5.x the --showtime option was removed, thus no timestamps
in the row elements.
But we can easily calculate them using the start timestamp and the step
size.

That option seems to be back in rrdtool 1.6 but nobody knows in
what lts distribution 1.5 will land, this soloution should work
regardless of the of the version, no checking necessary.

Copy link
Member

@tonioo tonioo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, thank you :)

for vindex, value in enumerate(row.findall('v')):
if value.text == 'NaN':
result[vindex]['data'].append({'x': timestamp, 'y': 0})
else:
result[vindex]['data'].append(
{'x': timestamp, 'y': float(value.text)}
)
timestamp +=step
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after operator.

in version 1.5.x the --showtime option was removed, thus no timestamps
in the row elements.
But we can easily calculate them using the start timestamp and the step
size.

That option seems to be back in rrdtool 1.6 but nobody knows in
what lts distribution 1.5 will land, this soloution should work
regardless of the of the version, no checking necessary.
@Arvedui
Copy link
Contributor Author

Arvedui commented Sep 19, 2016

Ah sorry missed that one.
It is fixed now.

@tonioo tonioo merged commit 4ef3cc7 into modoboa:master Sep 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants