mirror of
https://github.com/napalm-automation-community/napalm-vyos.git
synced 2026-09-22 20:21:16 +00:00
fixes for pylama
This commit is contained in:
@@ -92,10 +92,10 @@ class VyOSDriver(NetworkDriver):
|
|||||||
|
|
||||||
def open(self):
|
def open(self):
|
||||||
self.device = ConnectHandler(device_type='vyos',
|
self.device = ConnectHandler(device_type='vyos',
|
||||||
host=self._hostname,
|
host=self._hostname,
|
||||||
username=self._username,
|
username=self._username,
|
||||||
password=self._password,
|
password=self._password,
|
||||||
**self.netmiko_optional_args)
|
**self.netmiko_optional_args)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._scp_client = SCPConn(self.device)
|
self._scp_client = SCPConn(self.device)
|
||||||
@@ -143,7 +143,7 @@ class VyOSDriver(NetworkDriver):
|
|||||||
if os.path.exists(filename) is True:
|
if os.path.exists(filename) is True:
|
||||||
with open(filename) as f:
|
with open(filename) as f:
|
||||||
self.device.send_command("cp "+self._BOOT_FILENAME+" "
|
self.device.send_command("cp "+self._BOOT_FILENAME+" "
|
||||||
+ self._BACKUP_FILENAME)
|
+ self._BACKUP_FILENAME)
|
||||||
self._new_config = f.read()
|
self._new_config = f.read()
|
||||||
cfg = [x for x in self._new_config.split("\n") if x is not ""]
|
cfg = [x for x in self._new_config.split("\n") if x is not ""]
|
||||||
output_loadcmd = self.device.send_config_set(cfg)
|
output_loadcmd = self.device.send_config_set(cfg)
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ class PatchedVyOSDriver(vyos.VyOSDriver):
|
|||||||
|
|
||||||
self.patched_attrs = ['device']
|
self.patched_attrs = ['device']
|
||||||
self.device = FakeVyOSDevice()
|
self.device = FakeVyOSDevice()
|
||||||
#self._device = FakeVyOSDevice()
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
pass
|
pass
|
||||||
@@ -54,8 +53,6 @@ class PatchedVyOSDriver(vyos.VyOSDriver):
|
|||||||
class FakeVyOSDevice(BaseTestDouble):
|
class FakeVyOSDevice(BaseTestDouble):
|
||||||
"""VyOS device test double."""
|
"""VyOS device test double."""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def send_command(self, command, **kwargs):
|
def send_command(self, command, **kwargs):
|
||||||
filename = '{}.text'.format(self.sanitize_text(command))
|
filename = '{}.text'.format(self.sanitize_text(command))
|
||||||
print filename
|
print filename
|
||||||
|
|||||||
Reference in New Issue
Block a user