Skip to content

Commit

Permalink
Black format
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron-MJohn committed Feb 7, 2023
1 parent e2f4a4e commit 31d7aee
Show file tree
Hide file tree
Showing 19 changed files with 250 additions and 250 deletions.
203 changes: 105 additions & 98 deletions docs/conf.py

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion lib/jnpr/junos/cfg/phyport/classic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class PhyPortClassic(PhyPortBase):

# -----------------------------------------------------------------------
# XML readers
# -----------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion lib/jnpr/junos/cfg/phyport/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class PhyPortSwitch(PhyPortBase):

PORT_SPEED = {
"auto": "auto-negotiation",
"10m": "ethernet-10m",
Expand Down
1 change: 0 additions & 1 deletion lib/jnpr/junos/cfg/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class Resource(object):

PROPERTIES = [P_JUNOS_EXISTS, P_JUNOS_ACTIVE]

def __init__(self, junos, namevar=None, **kvargs):
Expand Down
1 change: 0 additions & 1 deletion lib/jnpr/junos/factory/cfgtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class CfgTable(Table):

__isfrozen = False

# -----------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion lib/jnpr/junos/factory/factory_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion lib/jnpr/junos/factory/optable.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class OpTable(Table):

# -------------------------------------------------------------------------
# PUBLIC METHODS
# -------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions lib/jnpr/junos/facts/__example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/jnpr/junos/facts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion lib/jnpr/junos/ofacts/personality.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


def facts_personality(junos, facts):

model = facts["model"]

if model != "Virtual Chassis":
Expand Down
1 change: 0 additions & 1 deletion lib/jnpr/junos/ofacts/routing_engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
1 change: 0 additions & 1 deletion lib/jnpr/junos/ofacts/swver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion lib/jnpr/junos/rpcmeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class _RpcMetaExec(object):

# -----------------------------------------------------------------------
# CONSTRUCTOR
# -----------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion lib/jnpr/junos/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
1 change: 0 additions & 1 deletion lib/jnpr/junos/utils/scp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
16 changes: 10 additions & 6 deletions tests/functional/test_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
import yaml


@attr('functional')
@attr("functional")
class test(unittest.TestCase):

@classmethod
def setUpClass(self):
from jnpr.junos import Device

with open("config.yaml", "r") as fyaml:
cfg = yaml.safe_load(fyaml)
self.dev = Device(**cfg)
Expand All @@ -26,24 +26,28 @@ def tearDownClass(self):

def test_shell_run(self):
from jnpr.junos.utils.start_shell import StartShell

with StartShell(self.dev) as sh:
output = sh.run('pwd')
output = sh.run("pwd")
self.assertTrue(output[0])

def test_shell_run_with_sleep(self):
from jnpr.junos.utils.start_shell import StartShell

with StartShell(self.dev) as sh:
output = sh.run('hostname', sleep=2)
output = sh.run("hostname", sleep=2)
self.assertTrue(output[0])

def test_shell_run_shell_type_ssh(self):
from jnpr.junos.utils.start_shell import StartShell

with StartShell(self.dev, shell_type="ssh") as sh:
output = sh.run('hostname', sleep=2)
output = sh.run("hostname", sleep=2)
self.assertTrue(output[0])

def test_shell_run_shell_type_csh(self):
from jnpr.junos.utils.start_shell import StartShell

with StartShell(self.dev, shell_type="csh") as sh:
output = sh.run('hostname', sleep=2)
output = sh.run("hostname", sleep=2)
self.assertTrue(output[0])

0 comments on commit 31d7aee

Please sign in to comment.