Skip to content

Commit

Permalink
Merge branch 'Juniper:master' into bugfix/serial_connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron-MJohn authored Aug 29, 2024
2 parents ea13744 + a64698b commit 08c5d09
Show file tree
Hide file tree
Showing 51 changed files with 72 additions and 53 deletions.
5 changes: 5 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Release 2.7.2 - 12 APR 2024
## Features Added

## Bugs Fixed

## Release 2.7.1 - 12 APR 2024
## Features Added
- Added customer juniper paramiko module as a dependency which supported aes128 and aes257 cipher #1299
Expand Down
3 changes: 1 addition & 2 deletions development.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
-r requirements.txt

coverage # http://nedbatchelder.com/code/coverage/
mock # http://www.voidspace.org.uk/python/mock/
nose2 # https://docs.nose2.io/en/latest/
pep8 # https://github.com/jcrocholl/pep8
pyflakes # https://launchpad.net/pyflakes
coveralls # https://coveralls.io/
ntc_templates # user needs to explicitly install this
cryptography==3.2
cryptography==3.2
21 changes: 18 additions & 3 deletions lib/jnpr/junos/utils/sw.py
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,16 @@ def reboot(
:returns:
* reboot message (string) if command successful
"""

if self._multi_VC_nsync is True or self._multi_VC is True:
vc_members = [
re.search(r"(\d+)", x).group(1)
for x in self._RE_list
if re.search(r"(\d+)", x)
]
vc_members.remove(self.dev.facts["vc_master"])
vc_members.insert(len(vc_members), self.dev.facts["vc_master"])

if self._dev.facts["_is_linux"]:
if on_node is None:
cmd = E("request-shutdown-reboot")
Expand All @@ -1220,9 +1230,14 @@ def reboot(
cmd = E("request-reboot")

try:
return self._system_operation(
cmd, in_min, at, all_re, other_re, vmhost, member_id
)
if member_id is not None:
for m_id in member_id:
if m_id in vc_members:
return self._system_operation(
cmd, in_min, at, all_re, other_re, vmhost, member_id=m_id
)
else:
return self._system_operation(cmd, in_min, at, all_re, other_re, vmhost)
except RpcTimeoutError as err:
raise err
except Exception as err:
Expand Down
2 changes: 1 addition & 1 deletion lib/jnpr/junos/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "2.7.1"
VERSION = "2.7.2.dev0"
DATE = "2024-Apr-12"

# Augment with the internal version if present
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys

import nose2
from mock import patch
from unittest.mock import patch

__author__ = "Nitin Kumar"
__credits__ = "Jeremy Schulman"
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/factory/test_cfgtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from ncclient.manager import Manager, make_device_handler
from ncclient.transport import SSHSession
from lxml import etree
from mock import MagicMock, patch
from unittest.mock import MagicMock, patch

from jnpr.junos.factory import loadyaml
from jnpr.junos.factory.factory_loader import FactoryLoader
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/factory/test_cmdtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from ncclient.manager import Manager, make_device_handler
from ncclient.transport import SSHSession
from mock import MagicMock, patch
from unittest.mock import MagicMock, patch
import yamlordereddictloader
from jnpr.junos.factory.factory_loader import FactoryLoader
import yaml
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/factory/test_factory_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import unittest
import nose2
from jnpr.junos.factory import FactoryLoader
from mock import patch
from unittest.mock import patch


class TestFactoryLoader(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/factory/test_optable.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from lxml import etree

from mock import patch
from unittest.mock import patch


class TestFactoryOpTable(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/factory/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from jnpr.junos import Device
from jnpr.junos.factory.table import Table

from mock import patch
from unittest.mock import patch
from lxml import etree
from jnpr.junos.op.phyport import PhyPortTable

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/factory/test_to_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
except ImportError:
import unittest
import nose2
from mock import patch
from unittest.mock import patch
import os
import json

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/factory/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import MagicMock, patch
from unittest.mock import MagicMock, patch
from jnpr.junos import Device
from jnpr.junos.factory.view import View
from jnpr.junos.op.phyport import PhyPortStatsTable, PhyPortStatsView
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facts/test_current_re.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os
from lxml import etree

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facts/test_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os
from lxml import etree

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facts/test_ethernet_mac_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os
from lxml import etree

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facts/test_file_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os

from jnpr.junos import Device
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facts/test_get_chassis_cluster_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os
from lxml import etree

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facts/test_get_chassis_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os

from jnpr.junos import Device
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facts/test_get_route_engine_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os
from lxml import etree

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facts/test_get_software_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os
from lxml import etree

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facts/test_get_virtual_chassis_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os
import sys
from lxml import etree
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facts/test_ifd_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os
from lxml import etree

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facts/test_iri_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os

from jnpr.junos import Device
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/facts/test_personality.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os
from jnpr.junos.exception import RpcError

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ofacts/test_chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
from lxml import etree
import os

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ofacts/test_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
from lxml import etree

from jnpr.junos.ofacts.domain import facts_domain
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ofacts/test_ifd_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__credits__ = "Jeremy Schulman"

import unittest
from mock import patch
from unittest.mock import patch
import nose2

from jnpr.junos import Device
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ofacts/test_personality.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__credits__ = "Jeremy Schulman"

import unittest
from mock import patch
from unittest.mock import patch
import nose2

from jnpr.junos import Device
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ofacts/test_routing_engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os
import sys

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ofacts/test_srx_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import unittest
import nose2
from mock import patch
from unittest.mock import patch
import os

from jnpr.junos import Device
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ofacts/test_switch_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__credits__ = "Jeremy Schulman"

import unittest
from mock import patch
from unittest.mock import patch
import nose2

from jnpr.junos import Device
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ofacts/test_swver.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
except ImportError:
import unittest
import nose2
from mock import patch, MagicMock
from unittest.mock import patch, MagicMock
import os

from jnpr.junos import Device
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import unittest
from jnpr.junos.utils.config import Config
import nose2
from mock import patch, MagicMock, call
from unittest.mock import patch, MagicMock, call
import re
import sys
import os
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from jnpr.junos.decorators import timeoutDecorator, normalizeDecorator
from jnpr.junos.decorators import ignoreWarnDecorator

from mock import patch, MagicMock, PropertyMock, call
from unittest.mock import patch, MagicMock, PropertyMock, call

from ncclient.operations.rpc import RPCError
from ncclient.manager import Manager, make_device_handler
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
except ImportError:
import unittest
import nose2
from mock import MagicMock, patch, mock_open, call
from unittest.mock import MagicMock, patch, mock_open, call
import os
from lxml import etree
import sys
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_factcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
except ImportError:
import unittest
import nose2
from mock import patch, MagicMock, call
from unittest.mock import patch, MagicMock, call
from jnpr.junos.exception import FactLoopError

from jnpr.junos import Device
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_junos.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys

import nose2
from mock import patch
from unittest.mock import patch

__author__ = "Nitin Kumar"
__credits__ = "Jeremy Schulman"
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_jxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import unittest
from io import StringIO
import nose2
from mock import patch
from unittest.mock import patch
from jnpr.junos.jxml import (
NAME,
INSERT,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_rpcmeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from ncclient.transport import SSHSession
from jnpr.junos.exception import JSONLoadError

from mock import patch, MagicMock, call
from unittest.mock import patch, MagicMock, call
from lxml import etree

__author__ = "Nitin Kumar, Rick Sherman"
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/transport/test_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
except ImportError:
import unittest
import nose2
from mock import MagicMock, patch
from unittest.mock import MagicMock, patch
import sys
import six

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/transport/test_tty.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import unittest

import nose2
from mock import MagicMock, patch
from unittest.mock import MagicMock, patch

from jnpr.junos.transport.tty import Terminal
from jnpr.junos import exception as EzErrors
Expand Down
Loading

0 comments on commit 08c5d09

Please sign in to comment.