Sat Oct 25 22:48:08 2014 +0200 Emmanuel Garette <egarette@cadoles.com>
* cannot add unvalaible consistency for an option
+ * allow number as first letter of a domainname with netbios type
Fri Jun 20 16:27:55 2014 +0200 Emmanuel Garette <egarette@cadoles.com>
from tiramisu.config import Config, SubConfig
from tiramisu.option import IntOption, FloatOption, StrOption, ChoiceOption, \
BoolOption, UnicodeOption, OptionDescription
+from tiramisu.i18n import _
from tiramisu.error import ConflictError, ConfigError, PropertiesOptionError
import weakref
end = ''
extrachar = ''
extrachar_mandatory = ''
- if extra['_dom_type'] != 'netbios':
- allow_number = '\d'
- else:
- allow_number = '' # pragma: optional cover
if extra['_dom_type'] == 'netbios':
length = 14 # pragma: optional cover
elif extra['_dom_type'] == 'hostname':
else:
extrachar = '\.' # pragma: optional cover
end = '+[a-z]*'
- extra['_domain_re'] = re.compile(r'^(?:[a-z{0}][a-z\d\-{1}]{{,{2}}}{3}){4}$'
- ''.format(allow_number, extrachar, length,
+ extra['_domain_re'] = re.compile(r'^(?:[a-z\d][a-z\d\-{0}]{{,{1}}}{2}){3}$'
+ ''.format(extrachar, length,
extrachar_mandatory, end))
super(DomainnameOption, self).__init__(name, doc, default=default,
default_multi=default_multi,