Skip to content

Commit

Permalink
Remove unused variable in resetconf_config.py (ansible#65892)
Browse files Browse the repository at this point in the history
Our flake8 jobs for ansible.netcommon exposed this issue.

Signed-off-by: Paul Belanger <[email protected]>
  • Loading branch information
pabelanger authored Dec 16, 2019
1 parent 95d35a3 commit 83ad123
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/ansible/modules/network/restconf/restconf_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ def main():
result = {'changed': False, 'warnings': warnings}

running = None
response = None
commit = not module.check_mode
try:
running = restconf.get(module, path, output=format)
Expand All @@ -162,7 +161,7 @@ def main():
if method == 'delete':
if running:
if commit:
response = restconf.edit_config(module, path=path, method='DELETE')
restconf.edit_config(module, path=path, method='DELETE')
result['changed'] = True
else:
warnings.append("delete not executed as resource '%s' does not exist" % path)
Expand All @@ -182,7 +181,7 @@ def main():
result['diff'] = {'prepared': diff, 'before': candidate, 'after': running}

if commit:
response = restconf.edit_config(module, path=path, content=diff, method=method.upper(), format=format)
restconf.edit_config(module, path=path, content=diff, method=method.upper(), format=format)
result['changed'] = True

except ConnectionError as exc:
Expand Down

0 comments on commit 83ad123

Please sign in to comment.