adolfobolivar / AOS8-InfluDB-Grafana

Aruba AOS8, InfluxDB and Grafana: How to create your own dashboard
12 stars 6 forks source link

object has no attribute 'clear'` #1

Closed jonare77 closed 5 years ago

jonare77 commented 5 years ago

I get this error when running main.py, influx gets the tables:

Status_of_APs cpuload

But nothing else, seems like the listing of MC's goes wrong, we have two. Are there anyway to list the manually ?

Traceback (most recent call last): File "main.py", line 35, in <module> list_controllers_and_APs = controller_APs.list_controller_APs(list_ap_database) File "/home/administrator/AOS8-InfluDB-Grafana/controller_APs.py", line 18, in list_controller_APs data_AP_vMC.clear() AttributeError: 'list' object has no attribute 'clear'

adolfobolivar commented 5 years ago

"The list.clear() method was added in Python 3.3. The equivalent can be achieved in earlier versions by del primfac[:] instead." https://stackoverflow.com/questions/39944586/clear-for-list-not-working-python/39944686

jonare77 commented 5 years ago

Thanx, fixed it.

Running into another problem, can you help out with this one:

Traceback (most recent call last): File "main.py", line 61, in <module> list_associations_per_ap = show_command_via_API.show_command(d[0].get('Switch IP'),token,command)['Association Table'] File "/home/administrator/AOS8-InfluDB-Grafana/show_command_via_API.py", line 19, in show_command AOS_response = AOS_response.json() File "/usr/lib/python3/dist-packages/requests/models.py", line 892, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None