summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-07-28 11:44:32 -0400
committerScott Moser <smoser@ubuntu.com>2015-07-28 11:44:32 -0400
commit55472eb02eaa5b88676a96e006f6838020f8ffe3 (patch)
tree54474328e1db2e470c73adfda1cf74214f14fb9b /tests
parentdb07b4b2b083bf8852cc5ae355892d5ff6282193 (diff)
downloadvyos-cloud-init-55472eb02eaa5b88676a96e006f6838020f8ffe3.tar.gz
vyos-cloud-init-55472eb02eaa5b88676a96e006f6838020f8ffe3.zip
rsyslog: skip empty or None in remotes format
This allows user to specify the following to overwrite a previously declared entry without warnings. rsyslog: {'remotes': {'foo': None}}
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_handler/test_handler_rsyslog.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/unittests/test_handler/test_handler_rsyslog.py b/tests/unittests/test_handler/test_handler_rsyslog.py
index 7bfa65a9..b932165c 100644
--- a/tests/unittests/test_handler/test_handler_rsyslog.py
+++ b/tests/unittests/test_handler/test_handler_rsyslog.py
@@ -163,3 +163,12 @@ class TestRemotesToSyslog(t_help.TestCase):
lines = r.splitlines()
self.assertTrue(header, lines[0])
self.assertTrue(footer, lines[-1])
+
+ def test_with_empty_or_null(self):
+ mycfg = "*.* myhost"
+ myline = str(parse_remotes_line(mycfg, name="myname"))
+ r = remotes_to_rsyslog_cfg(
+ {'myname': mycfg, 'removed': None, 'removed2': ""})
+ lines = r.splitlines()
+ self.assertEqual(1, len(lines))
+ self.assertTrue(myline in r.splitlines())