added support for python 2.6.6#443
Conversation
... due to an uninitialized data variable.
fixing flake8/pep8 issues fixing flake8/pep8 issues again travis for Python 2.6 fixing AttributeError on python 2.6.9 pep8 pep8 travis checks for 2.6.x unittest for travis checks for 2.6.x passing travis tests 2.7 - forward implemented changes suggested by @xginn8 copied requirements and __init__.py from upstream Added back the AttributeError exception Added back the AttributeError exception and included datetime removed comment
|
Corrected issues with previous pull request. |
|
nice! <3 Can we add 2.6 tests on travis? |
|
Can you please rebase against existing master and ensure this check passes the new set of tests? Also, can you please squash these commits into one? @aviau UPDATE REQUESTED |
|
@eorochena, any chance you'd be able to rebase + add a test or two for py2.6.6? We can add this into the travis CI |
|
Sorry, I was a little busy, I'll see what I can do to make this happen. |
sebito91
left a comment
There was a problem hiding this comment.
Rebase and retest please!
|
finally updated branch, sorry for the delay |
|
That's fine, thanks for updating. Would you mind please adding a test case to your PR for python v2.6.6 to ensure everything passes? |
|
For some reason Travis CI keeps failing with
I can't pinpoint where the actual error is |
sebito91
left a comment
There was a problem hiding this comment.
Couple of things, will look into the travis issues and reply separately.
Thanks for adding the updates!
| @@ -0,0 +1,57 @@ | |||
| #!/usr/bin/python | |||
There was a problem hiding this comment.
You should change this to #!/usr/bin/env python otherwise this might not use the correct version.
| influxdb_server = "localhost" | ||
| port = 8086 | ||
| database_name = "test_db" | ||
| ip_addr = os.popen("hostname").read() |
There was a problem hiding this comment.
This is somewhat problematic, you should use the socket infra instead of popen.
In [1]: import socket
In [2]: ip = socket.gethostbyname(socket.gethostname())
In [3]: ip
Out[3]: '192.168.1.77'
There was a problem hiding this comment.
I will use socket.gethostname() because socket.gethostbyname(socket.gethostname()) tends to give the loopback interface ip address this value is pulled from the /etc/hosts file by default on stuck configuration 127.0.0.1 is associated to the hostname
| sys.exit(2) | ||
|
|
||
| # System Load | ||
| load_avg_1 = os.popen("cat /proc/loadavg|awk '{print $1,$2,$3}'").read()[0] |
There was a problem hiding this comment.
Can you please look to use the subprocess.check_output method here? The os.popen commands have been deprecated.
https://docs.python.org/2/library/subprocess.html#subprocess.check_output
https://docs.python.org/2/library/subprocess.html#replacing-os-popen-os-popen2-os-popen3
There was a problem hiding this comment.
unfortunately, check_output is not available on python2.6
| client.write_points(load_15) | ||
|
|
||
| counter += 1 | ||
| time.sleep(3) |
There was a problem hiding this comment.
This is a long sleep, mind making this 1s?
| return ns / 1e9 / 3600 | ||
|
|
||
| raise ValueError(timestamp) | ||
| raise ValueError(timestamp) |
There was a problem hiding this comment.
This should be outdented, otherwise what happens if we don't hit any of the first two isinstance checks?
|
Implemented requested changes |
|
Was thinking to add something like this for |
|
The issue is in your py26_test.py, which makes sense since it's not using proper |
|
OK, if you move remove your current We'll need to refactor some of the test code to bring these helpers out into the harness more easily, but for now this should get you working. |
|
Implemented requested changes all travis ci checks passed |
|
We're not supporting <python2.7 at this point. Closing issue... |
fixing flake8/pep8 issues
fixing flake8/pep8 issues again
travis for Python 2.6
fixing AttributeError on python 2.6.9
pep8
pep8
travis checks for 2.6.x
unittest for travis checks for 2.6.x
passing travis tests 2.7 - forward
implemented changes suggested by @xginn8
copied requirements and init.py from upstream
Added back the AttributeError exception
Added back the AttributeError exception and included datetime
removed comment