Patch fixes indentation in one function in ipalib/util.py -- Martin^2 Basti
>From dda5b130fc6546a53e85301a4e93c6f6130e0074 Mon Sep 17 00:00:00 2001 From: Martin Basti <mba...@redhat.com> Date: Fri, 30 May 2014 13:49:02 +0200 Subject: [PATCH] Fix indentation
There was 5 spaces instead of 4, my bad. --- ipalib/util.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ipalib/util.py b/ipalib/util.py index 3fc8544810d0e45eb1dca9bed357ffd51c401560..a2c2a90e47181dbf45b1954c1edc8d6bd0184962 100644 --- a/ipalib/util.py +++ b/ipalib/util.py @@ -221,33 +221,33 @@ def normalize_zone(zone): def validate_dns_label(dns_label, allow_underscore=False, allow_slash=False): - base_chars = 'a-z0-9' - extra_chars = '' - middle_chars = '' + base_chars = 'a-z0-9' + extra_chars = '' + middle_chars = '' - if allow_underscore: - extra_chars += '_' - if allow_slash: - middle_chars += '/' + if allow_underscore: + extra_chars += '_' + if allow_slash: + middle_chars += '/' - middle_chars = middle_chars + '-' #has to be always the last in the regex [....-] + middle_chars = middle_chars + '-' #has to be always the last in the regex [....-] - label_regex = r'^[%(base)s%(extra)s]([%(base)s%(extra)s%(middle)s]?[%(base)s%(extra)s])*$' \ - % dict(base=base_chars, extra=extra_chars, middle=middle_chars) - regex = re.compile(label_regex, re.IGNORECASE) + label_regex = r'^[%(base)s%(extra)s]([%(base)s%(extra)s%(middle)s]?[%(base)s%(extra)s])*$' \ + % dict(base=base_chars, extra=extra_chars, middle=middle_chars) + regex = re.compile(label_regex, re.IGNORECASE) - if not dns_label: - raise ValueError(_('empty DNS label')) + if not dns_label: + raise ValueError(_('empty DNS label')) - if len(dns_label) > 63: - raise ValueError(_('DNS label cannot be longer that 63 characters')) + if len(dns_label) > 63: + raise ValueError(_('DNS label cannot be longer that 63 characters')) - if not regex.match(dns_label): - chars = ', '.join("'%s'" % c for c in extra_chars + middle_chars) - chars2 = ', '.join("'%s'" % c for c in middle_chars) - raise ValueError(_("only letters, numbers, %(chars)s are allowed. " \ - "DNS label may not start or end with %(chars2)s") \ - % dict(chars=chars, chars2=chars2)) + if not regex.match(dns_label): + chars = ', '.join("'%s'" % c for c in extra_chars + middle_chars) + chars2 = ', '.join("'%s'" % c for c in middle_chars) + raise ValueError(_("only letters, numbers, %(chars)s are allowed. " \ + "DNS label may not start or end with %(chars2)s") \ + % dict(chars=chars, chars2=chars2)) def validate_domain_name(domain_name, allow_underscore=False, allow_slash=False): -- 1.8.3.1
_______________________________________________ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel