adolfobolivar / AOS8-InfluDB-Grafana

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

AttributeError: 'list' object has no attribute 'copy' #3

Open mzac opened 5 years ago

mzac commented 5 years ago

I'm getting this error, running python 2.7.5 on Redhat 7

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 "/opt/AOS8-InfluDB-Grafana/controller_APs.py", line 25, in list_controller_APs
    data_AP_vMC_list.append([{'Switch IP':value},{'APs':data_AP_vMC.copy()}])
AttributeError: 'list' object has no attribute 'copy'

Something wrong here but I don't know enough about pythong to fix it...

https://github.com/adolfobolivar/AOS8-InfluDB-Grafana/blob/master/controller_APs.py#L24

mzac commented 5 years ago

I found a way to run it in a venv on redhat with python 3.6, This might help some other people as Redhat ships with Python 2.7 by default

https://developers.redhat.com/blog/2018/08/13/install-python3-rhel/

yum install rh-python36
scl enable rh-python36 bash
mkidr /opt/aos8-influx
cd /opt/aos8-influx
python3 -m venv py36-venv
source py36-venv/bin/activate
pip install influxdb
git clone https://github.com/adolfobolivar/AOS8-InfluDB-Grafana.git
cd AOS8-InfluDB-Grafana
python main.py