From 4fe182f2a6cbc5c7a1c010c0fd43c1c47b653a0b Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Fri, 10 Feb 2023 10:27:06 +0530 Subject: [PATCH 1/3] Fix for issue #1231 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9b395cbe1..de0dd9d21 100755 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ "jnpr.junos.cfgro": ["*.yml"], "jnpr.junos.resources": ["*.yml"], }, - python_requires=">=3.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", + python_requires=">=3.5, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", install_requires=install_reqs, classifiers=[ "Development Status :: 5 - Production/Stable", From 71f0789d9a1fb0c0b7cf2646bf2d825779793192 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Fri, 10 Feb 2023 11:59:25 +0530 Subject: [PATCH 2/3] Fix for issue #1231 Fix for black tool formating errors --- lib/jnpr/junos/cfg/phyport/classic.py | 1 - lib/jnpr/junos/cfg/phyport/switch.py | 1 - lib/jnpr/junos/cfg/resource.py | 1 - lib/jnpr/junos/factory/factory_loader.py | 1 - lib/jnpr/junos/factory/optable.py | 1 - lib/jnpr/junos/facts/__example.py | 1 + lib/jnpr/junos/facts/__init__.py | 2 +- lib/jnpr/junos/ofacts/personality.py | 1 - lib/jnpr/junos/ofacts/routing_engines.py | 1 - lib/jnpr/junos/ofacts/swver.py | 1 - lib/jnpr/junos/utils/config.py | 1 - lib/jnpr/junos/utils/scp.py | 1 - 12 files changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/jnpr/junos/cfg/phyport/classic.py b/lib/jnpr/junos/cfg/phyport/classic.py index 0b525dd1e..4023f74eb 100644 --- a/lib/jnpr/junos/cfg/phyport/classic.py +++ b/lib/jnpr/junos/cfg/phyport/classic.py @@ -8,7 +8,6 @@ class PhyPortClassic(PhyPortBase): - # ----------------------------------------------------------------------- # XML readers # ----------------------------------------------------------------------- diff --git a/lib/jnpr/junos/cfg/phyport/switch.py b/lib/jnpr/junos/cfg/phyport/switch.py index aaa1fd2a0..1690cc952 100644 --- a/lib/jnpr/junos/cfg/phyport/switch.py +++ b/lib/jnpr/junos/cfg/phyport/switch.py @@ -8,7 +8,6 @@ class PhyPortSwitch(PhyPortBase): - PORT_SPEED = { "auto": "auto-negotiation", "10m": "ethernet-10m", diff --git a/lib/jnpr/junos/cfg/resource.py b/lib/jnpr/junos/cfg/resource.py index 358823329..037804305 100644 --- a/lib/jnpr/junos/cfg/resource.py +++ b/lib/jnpr/junos/cfg/resource.py @@ -13,7 +13,6 @@ class Resource(object): - PROPERTIES = [P_JUNOS_EXISTS, P_JUNOS_ACTIVE] def __init__(self, junos, namevar=None, **kvargs): diff --git a/lib/jnpr/junos/factory/factory_loader.py b/lib/jnpr/junos/factory/factory_loader.py index 7c60ae375..a030a05eb 100644 --- a/lib/jnpr/junos/factory/factory_loader.py +++ b/lib/jnpr/junos/factory/factory_loader.py @@ -389,7 +389,6 @@ def _sortitems(self): self._item_views.append(k) def load(self, catalog_dict, envrion={}): - # load the yaml data and extract the item names. these names will # become the new class definitions diff --git a/lib/jnpr/junos/factory/optable.py b/lib/jnpr/junos/factory/optable.py index 5cefd7c3e..4e22cd318 100644 --- a/lib/jnpr/junos/factory/optable.py +++ b/lib/jnpr/junos/factory/optable.py @@ -14,7 +14,6 @@ class OpTable(Table): - # ------------------------------------------------------------------------- # PUBLIC METHODS # ------------------------------------------------------------------------- diff --git a/lib/jnpr/junos/facts/__example.py b/lib/jnpr/junos/facts/__example.py index 03f2c833c..89866dbd7 100644 --- a/lib/jnpr/junos/facts/__example.py +++ b/lib/jnpr/junos/facts/__example.py @@ -16,6 +16,7 @@ # An import for each fact file must be present in # lib/jnpr/junos/facts/__init__.py + # The file must include a provide_facts() function # The provide_facts() function must return a dictionary. The keys of the # dictionary are each fact that is handled/returned by this module. The value diff --git a/lib/jnpr/junos/facts/__init__.py b/lib/jnpr/junos/facts/__init__.py index 6ca33d7de..821a7b595 100644 --- a/lib/jnpr/junos/facts/__init__.py +++ b/lib/jnpr/junos/facts/__init__.py @@ -66,7 +66,7 @@ def _build_fact_callbacks_and_doc_strings(): """ callbacks = {} doc_strings = {} - for (name, module) in sys.modules.items(): + for name, module in sys.modules.items(): if name.startswith("jnpr.junos.facts.") and module is not None: new_doc_strings = module.provides_facts() for key in new_doc_strings: diff --git a/lib/jnpr/junos/ofacts/personality.py b/lib/jnpr/junos/ofacts/personality.py index 37ab9bd00..f2057a2fe 100644 --- a/lib/jnpr/junos/ofacts/personality.py +++ b/lib/jnpr/junos/ofacts/personality.py @@ -2,7 +2,6 @@ def facts_personality(junos, facts): - model = facts["model"] if model != "Virtual Chassis": diff --git a/lib/jnpr/junos/ofacts/routing_engines.py b/lib/jnpr/junos/ofacts/routing_engines.py index ac89ec982..cdd558bc0 100644 --- a/lib/jnpr/junos/ofacts/routing_engines.py +++ b/lib/jnpr/junos/ofacts/routing_engines.py @@ -17,7 +17,6 @@ def _get_vc_status(dev, facts): def facts_routing_engines(junos, facts): - re_facts = ["mastership-state", "status", "model", "up-time", "last-reboot-reason"] master = [] diff --git a/lib/jnpr/junos/ofacts/swver.py b/lib/jnpr/junos/ofacts/swver.py index 7f2cc93ea..642fce734 100644 --- a/lib/jnpr/junos/ofacts/swver.py +++ b/lib/jnpr/junos/ofacts/swver.py @@ -64,7 +64,6 @@ def facts_software_version(junos, facts): facts["hostname"] = x_swver.findtext(".//software-information/host-name") for re_sw in x_swver.xpath(".//software-information"): - re_name = re_sw.xpath("preceding-sibling::re-name")[0].text # handle the cases where the "RE name" could be things like diff --git a/lib/jnpr/junos/utils/config.py b/lib/jnpr/junos/utils/config.py index 8c98ab709..d53baf2b7 100644 --- a/lib/jnpr/junos/utils/config.py +++ b/lib/jnpr/junos/utils/config.py @@ -824,7 +824,6 @@ def __init__(self, dev, mode=None, **kwargs): Util.__init__(self, dev=dev) def __enter__(self): - # defining separate functions for each mode so that can be # changed/edited as per the need of corresponding rpc call. def _open_configuration_private(): diff --git a/lib/jnpr/junos/utils/scp.py b/lib/jnpr/junos/utils/scp.py index 5601f5e00..6bfc727b3 100644 --- a/lib/jnpr/junos/utils/scp.py +++ b/lib/jnpr/junos/utils/scp.py @@ -59,7 +59,6 @@ def _progress(self, report): print(self._junos.hostname + ": " + report) def _scp_progress(self, _path, _total, _xfrd): - # calculate current percentage xferd pct = int(float(_xfrd) / float(_total) * 100) From e7a2c8b050554a70ea408d5fa85f804346398e16 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Fri, 10 Feb 2023 12:02:38 +0530 Subject: [PATCH 3/3] Fix for issue #1231 Fix for black tool formating errors --- lib/jnpr/junos/factory/cfgtable.py | 1 - lib/jnpr/junos/rpcmeta.py | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/jnpr/junos/factory/cfgtable.py b/lib/jnpr/junos/factory/cfgtable.py index 0d7d3d341..333891c2a 100644 --- a/lib/jnpr/junos/factory/cfgtable.py +++ b/lib/jnpr/junos/factory/cfgtable.py @@ -9,7 +9,6 @@ class CfgTable(Table): - __isfrozen = False # ----------------------------------------------------------------------- diff --git a/lib/jnpr/junos/rpcmeta.py b/lib/jnpr/junos/rpcmeta.py index d667c1927..e1bc8f118 100644 --- a/lib/jnpr/junos/rpcmeta.py +++ b/lib/jnpr/junos/rpcmeta.py @@ -6,7 +6,6 @@ class _RpcMetaExec(object): - # ----------------------------------------------------------------------- # CONSTRUCTOR # -----------------------------------------------------------------------