From e3bd8c927e1e7480003a8141f03de3599fa966b5 Mon Sep 17 00:00:00 2001 From: Falk Date: Sat, 22 May 2021 18:11:37 +0200 Subject: [PATCH] Revert "Obtain version on class init, allow compatibility with 2.x and 3.x APIs." --- ise.py | 22 ++-------------------- requirements.txt | 2 -- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/ise.py b/ise.py index 42cea70..ca8a5fb 100644 --- a/ise.py +++ b/ise.py @@ -4,7 +4,6 @@ import re from furl import furl from datetime import datetime, timedelta -from bs4 import BeautifulSoup import requests @@ -48,10 +47,9 @@ def __init__(self, ise_node, ers_user, ers_pass, verify=False, disable_warnings= self.csrf_expires = None self.timeout = timeout self.ise.headers.update({'Connection': 'keep_alive'}) - + if self.disable_warnings: requests.packages.urllib3.disable_warnings() - self.version = self.get_version() @staticmethod def _mac_test(mac): @@ -142,22 +140,6 @@ def _request(self, url, method="get", data=None): return req - def get_version(self): - try: - # Build MnT API URL - url = "https://" + self.ise_node + "/admin/API/mnt/Version" - # Access MnT API - req = self.ise.request('get', url, data=None, timeout=self.timeout) - # Extract version of first node - soup = BeautifulSoup(req.content,'xml') - full_version = soup.find_all('version')[0].get_text() - # Get simple version ie: 2.7 - short_version = float(full_version[0:3]) - # print("ISE Initializing - Version Check " + full_version) - return short_version - except: - return "" - def _get_groups(self, url, filter: str = None, size: int = 20, page: int = 1): """ Get generic group lists. @@ -1419,4 +1401,4 @@ def delete_device(self, device): result['error'] = 404 return result else: - return ERS._pass_ersresponse(result, resp) \ No newline at end of file + return ERS._pass_ersresponse(result, resp) diff --git a/requirements.txt b/requirements.txt index 17244d6..d369ceb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,5 +14,3 @@ beautifulsoup4 furl lxml requests -beautifulsoup4 -lxml \ No newline at end of file