mocked data, handle errors during merrge
This commit is contained in:
1 parent
0518980ab8
commit
3878acb417
6 files changed
+13
-6
No files matched your search
+8
-1
@@ -146,7 +146,14 @@ class VyOSDriver(NetworkDriver):
|
||||
print self._device.send_command("cp "+self._BOOT_FILENAME+" "+self._BACKUP_FILENAME)
|
||||
self._new_config = f.read()
|
||||
cfg = [x for x in self._new_config.split("\n") if x is not ""]
|
||||
self._device.send_config_set(cfg)
|
||||
output_loadcmd = self._device.send_config_set(cfg)
|
||||
match_setfailed = re.findall("Delete failed", output_loadcmd)
|
||||
match_delfailed = re.findall("Set failed", output_loadcmd)
|
||||
|
||||
if match_setfailed or match_delfailed:
|
||||
raise MergeConfigException("Failed merge config: "
|
||||
+output_loadcmd)
|
||||
|
||||
else:
|
||||
raise MergeConfigException("config file is not found")
|
||||
elif config is not None:
|
||||
|
||||
Reference in new issue
Block a user