Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoeInterface does not work #20

Closed
johanreinalda opened this issue May 18, 2022 · 5 comments
Closed

PoeInterface does not work #20

johanreinalda opened this issue May 18, 2022 · 5 comments

Comments

@johanreinalda
Copy link

I have a CX6300 switch, which serves PoE to a bunch of Aruba AP's. When I run the code snippet below, I get an error stating "UNSUPPORTED CAPABILITY, This device is not PoE capable.", for either 10.04 or 10.08 api.
I can get interfaces shutdown, enabled, vlan changes, and more, but not this.
Any ideas ? (I am using the latest github pull, with the recent mac() fixes)

Output:

Getting sesion for 10.112.1.75
Firmware = FL.10.08.1040
Platform = 6300

Getting interface list...
Interface 1/1/1:
   poe.get() error - exception: 'UNSUPPORTED CAPABILITY, This device is not PoE capable.'
 ... (other interfaces removed for brevity)

My test code:

import sys
  
from pyaoscx.session import Session
from pyaoscx.device import Device
from pyaoscx.interface import Interface
from pyaoscx.poe_interface import PoEInterface

# disable unknown SSL cert warnings:
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

switch_ip = '10.112.1.75'
username = '***'
password = '***'

API_VERSION = '10.08'   # "10.04" or "10.08"

s =  Session(ip_address=switch_ip, api=API_VERSION)
try:
    print(f"Getting sesion for {switch_ip}")
    s.open(username=username, password=password)
except Exception as error:
    print('s.open() exception: {}. Cannot open session.'.format(error))
    sys.exit()

device = Device(s)
device.get()
print(f"Firmware = {device.firmware_version}")
print(f"Platform = {device.platform_name}")

print("\nGetting interface list...")
interface_dict = Interface.get_facts(session=s)
for ifname in interface_dict:
    print(f"Interface {ifname}:")
    try:
        # go get PoE info:
        interface = Interface(session=s, name=ifname)
        try:
            poe = PoEInterface(session=s, parent_interface=interface)
            try:
                poe.get(selector='status')
                print("   POE Exists!")
            except Exception as error:
                print(f"   poe.get() error - exception: {format(error)}")
        except Exception as error:
            print(f"   PoEInterface() error - exception: {format(error)}")
    except Exception as error:
        print(f"   Interface() error - exception: {format(error)}")

s.close()
@michaelrosejr
Copy link

It looks like the issue is that pyaoscx.poe_interface (line 65) should be poe and not quick_poe. I'll submit a PR if there isn't one already submitted to fix this bug.

@michaelrosejr
Copy link

A PR has been submitted for this fix.

@johanreinalda
Copy link
Author

Any information on when this PR will be pulled, or another fix posted ?

@michaelrosejr
Copy link

@johanreinalda It appears v2.3.0 fixed this issue.

@johanreinalda
Copy link
Author

Yes, this now works, since the change to poe_interface was posted several weeks back. Thanks! Now on to LLDP, etc. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants