diff --git a/cloudinit/tests/helpers.py b/cloudinit/tests/helpers.py
index feb884ab..baf5b99e 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(unittest2.TestCase, 'assertRaisesRegex'):
+ unittest2.TestCase.assertRaisesRegex = unittest2.TestCase.assertRaisesRegexp
+
+
# vi: ts=4 expandtab