Esempio n. 1
0
 def __instancecheck__(cls, instance):
     try:
         int(instance)
     except (ValueError, TypeError):
         return (isinstance(instance, six.string_types)
                 and uuidutils.is_uuid_like(instance))
     return (isinstance(instance, six.integer_types + six.string_types)
             and type(instance) != bool)
Esempio n. 2
0
 def __instancecheck__(cls, instance):
     try:
         int(instance)
     except (ValueError, TypeError):
         return (isinstance(instance, six.string_types)
                 and uuidutils.is_uuid_like(instance))
     return (isinstance(instance, six.integer_types + six.string_types)
             and type(instance) != bool)
Esempio n. 3
0
def validate_job_location_format(entry):
    if entry.startswith('internal-db://'):
        return uuidutils.is_uuid_like(entry[len("internal-db://"):])

    # TODO(mattf): remove support for OLD_SWIFT_INTERNAL_PREFIX
    if entry.startswith(su.SWIFT_INTERNAL_PREFIX) or (
            entry.startswith(su.OLD_SWIFT_INTERNAL_PREFIX)):
        # TODO(nprivalova):add hostname validation
        return True
    return False
Esempio n. 4
0
def validate_job_location_format(entry):
    if entry.startswith('internal-db://'):
        return uuidutils.is_uuid_like(entry[len("internal-db://"):])

    # TODO(mattf): remove support for OLD_SWIFT_INTERNAL_PREFIX
    if entry.startswith(su.SWIFT_INTERNAL_PREFIX) or (entry.startswith(
            su.OLD_SWIFT_INTERNAL_PREFIX)):
        #TODO(nprivalova):add hostname validation
        return True
    return False
Esempio n. 5
0
def validate_job_location_format(entry):
    if not isinstance(entry, six.string_types):
        # shoud fail type validation
        return True

    if entry.startswith('internal-db://'):
        return uuidutils.is_uuid_like(entry[len("internal-db://"):])

    if entry.startswith(su.SWIFT_INTERNAL_PREFIX):
        # TODO(nprivalova):add hostname validation
        return True
    return False
Esempio n. 6
0
def validate_uuid_format(entry):
    return uuidutils.is_uuid_like(entry)
Esempio n. 7
0
def validate_uuid_format(entry):
    return uuidutils.is_uuid_like(entry)
Esempio n. 8
0
def validate_uuid_format(entry):
    if not isinstance(entry, six.string_types):
        # shoud fail type validation
        return True

    return uuidutils.is_uuid_like(entry)
Esempio n. 9
0
def validate_uuid_format(entry):
    if not isinstance(entry, six.string_types):
        # shoud fail type validation
        return True

    return uuidutils.is_uuid_like(entry)