Fix the eos_banner idempotency (#22413)

The map_config_to_obj calls the run_commands  helper function,
which returns a list of results.
However, the map_params_to_obj return a single string.
Therefore, the comparison between the two datasets could never be equal,
breaking idempotency.
Also, the 'no banner' command should be run on absent only if there's a banner
text set.

Fixes #22194
This commit is contained in:
Ricardo Carrillo Cruz 2017-03-09 13:43:54 +01:00 committed by John R Barker
parent 0f82674c0e
commit c57729944b
2 changed files with 3 additions and 4 deletions

View file

@ -40,7 +40,7 @@ class TestEosBannerModule(TestEosModule):
self.mock_load_config.stop()
def load_fixtures(self, commands=None):
self.run_commands.return_value = load_fixture('eos_banner_show_banner.txt').strip()
self.run_commands.return_value = [load_fixture('eos_banner_show_banner.txt').strip()]
self.load_config.return_value = dict(diff=None, session='session')
def test_eos_banner_create(self):