diff --git a/cloudinit/tests/helpers.py b/cloudinit/tests/helpers.py
index feb884ab..7bab15c6 100644
--- a/cloudinit/tests/helpers.py
+++ b/cloudinit/tests/helpers.py
@@ -395,4 +395,9 @@ if not hasattr(mock.Mock, 'assert_not_called'):
mock.Mock.assert_not_called = __mock_assert_not_called
+# older unittest2.TestCase (centos6) do not have assertRaisesRegex
+if not hasattr(unittest.TestCase2, 'assertRaisesRegex'):
+ unittest.TestCase2.assertRaisesRegex = unittest.TestCase2.assertRaisesRegexp
+
+
# vi: ts=4 expandtab