Skip to content

Commit

Permalink
fix force
Browse files Browse the repository at this point in the history
  • Loading branch information
KB-perByte committed Mar 5, 2024
1 parent 7297a9f commit 3a453ba
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions plugins/cliconf/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@
NetworkConfig,
dumps,
)
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import to_list
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import (
to_list,
)
from ansible_collections.ansible.netcommon.plugins.plugin_utils.cliconf_base import (
CliconfBase,
enable_mode,
Expand Down Expand Up @@ -183,15 +185,10 @@ def get_config(self, source="running", flags=None, format=None):
return self.send_command(cmd)

@enable_mode
def restore(self, force=None, filename=None, path="flash://"):
def restore(self, filename=None, path=""):
if not filename:
raise ValueError("'file_name' value is required for restore")

if force:
cmd = f"configure replace {path}{filename} force"
else:
cmd = f"configure replace {path}{filename}"

cmd = f"configure replace {path}{filename} force"
return self.send_command(cmd)

def get_diff(
Expand Down Expand Up @@ -279,7 +276,9 @@ def get_diff(
configdiffobjs = candidate_obj.items
have_banners = {}

diff["config_diff"] = dumps(configdiffobjs, "commands") if configdiffobjs else ""
diff["config_diff"] = (
dumps(configdiffobjs, "commands") if configdiffobjs else ""
)
banners = self._diff_banners(want_banners, have_banners)
diff["banner_diff"] = banners if banners else {}
return diff
Expand Down

0 comments on commit 3a453ba

Please sign in to comment.