Allow default type's to contain underscores.

Fixes LP Bug #1188786.

Change-Id: I2ff2b4abc88ca914220a7de1fa0ef05a6105b9c1
This commit is contained in:
Dan Prince 2013-06-07 15:45:39 -04:00
parent e76e73a61d
commit 48e6c5f40e
2 changed files with 3 additions and 1 deletions

View File

@ -31,6 +31,8 @@ class ValueTypeTestCase(testtools.TestCase):
def test_default(self):
self.assertEqual("foobar",
value_types.ensure_type("foobar", "default"))
self.assertEqual("x86_64",
value_types.ensure_type("x86_64", "default"))
def test_default_bad(self):
self.assertRaises(config_exception.ConfigException,

View File

@ -19,7 +19,7 @@ from config_exception import ConfigException
TYPES = {
"int": "^[0-9]+$",
"default": "^[A-Za-z0-9]*$",
"default": "^[A-Za-z0-9_]*$",
"netaddress": "^[A-Za-z0-9/.:-]+$",
"raw": ""
}