Skip to content

Commit e3554eb

Browse files
committed
Honor ngs_save_configuration setting when using batch commands
Since [1], we have an option to skip saving configuration on the target devices. The batching implementation merged recently did not take into account this new setting, fix the issue. [1] https://review.opendev.org/c/openstack/networking-generic-switch/+/868314 Change-Id: I99ea7fcb1f3365c6ecc4c96b6aa8efea3ceb4bf7
1 parent 5246705 commit e3554eb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

networking_generic_switch/batching.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,9 @@ def _send_commands(self, device, batches, lock):
444444
# tell workers which batches have now been executed
445445
self.queue.record_result(batch)
446446

447-
try:
448-
device.save_configuration(net_connect)
449-
except Exception:
450-
LOG.exception("Failed to save configuration")
451-
# Probably not worth failing all batches for this.
447+
if device._get_save_configuration():
448+
try:
449+
device.save_configuration(net_connect)
450+
except Exception:
451+
LOG.exception("Failed to save configuration")
452+
# Probably not worth failing all batches for this.

0 commit comments

Comments
 (0)