コード例 #1
0
ファイル: nova_verifier.py プロジェクト: Priyaag/stacktach
def _verify_optional_validity(exist):
    fields = {exist.rax_options: 'rax_options',
              exist.os_architecture: 'os_architecture',
              exist.os_version: 'os_version',
              exist.os_distro: 'os_distro'}
    for (field_value, field_name) in fields.items():
        if field_value == '':
            raise NullFieldException(field_name, exist.id)
    base_verifier._is_int_in_char('rax_options', exist.rax_options, exist.id)
    base_verifier._is_alphanumeric('os_architecture', exist.os_architecture, exist.id)
    base_verifier._is_alphanumeric('os_distro', exist.os_distro, exist.id)
    base_verifier._is_alphanumeric('os_version', exist.os_version, exist.id)
コード例 #2
0
ファイル: nova_verifier.py プロジェクト: rcleere/stacktach
def _verify_optional_validity(exist):
    is_image_type_import = exist.is_image_type_import()
    fields = {exist.rax_options: "rax_options", exist.os_architecture: "os_architecture"}
    if not is_image_type_import:
        fields.update({exist.os_distro: "os_distro", exist.os_version: "os_version"})
    for (field_value, field_name) in fields.items():
        if field_value == "":
            raise NullFieldException(field_name, exist.id, exist.instance)
    base_verifier._is_int_in_char("rax_options", exist.rax_options, exist.id, exist.instance)
    base_verifier._is_alphanumeric("os_architecture", exist.os_architecture, exist.id, exist.instance)
    if not is_image_type_import:
        base_verifier._is_alphanumeric("os_distro", exist.os_distro, exist.id, exist.instance)
        base_verifier._is_alphanumeric("os_version", exist.os_version, exist.id, exist.instance)
コード例 #3
0
def _verify_optional_validity(exist):
    fields = {
        exist.rax_options: 'rax_options',
        exist.os_architecture: 'os_architecture',
        exist.os_version: 'os_version',
        exist.os_distro: 'os_distro'
    }
    for (field_value, field_name) in fields.items():
        if field_value == '':
            raise NullFieldException(field_name, exist.id, exist.instance)
    base_verifier._is_int_in_char('rax_options', exist.rax_options, exist.id,
                                  exist.instance)
    base_verifier._is_alphanumeric('os_architecture', exist.os_architecture,
                                   exist.id, exist.instance)
    base_verifier._is_alphanumeric('os_distro', exist.os_distro, exist.id,
                                   exist.instance)
    base_verifier._is_alphanumeric('os_version', exist.os_version, exist.id,
                                   exist.instance)
コード例 #4
0
def _verify_optional_validity(exist):
    is_image_type_import = exist.is_image_type_import()
    fields = {exist.rax_options: 'rax_options',
              exist.os_architecture: 'os_architecture'
              }
    if not is_image_type_import:
        fields.update({exist.os_distro: 'os_distro',
                       exist.os_version: 'os_version'})
    for (field_value, field_name) in fields.items():
        if field_value == '':
            raise NullFieldException(field_name, exist.id, exist.instance)
    base_verifier._is_int_in_char(
        'rax_options', exist.rax_options, exist.id, exist.instance)
    base_verifier._is_alphanumeric(
        'os_architecture', exist.os_architecture, exist.id, exist.instance)
    if not is_image_type_import:
        base_verifier._is_alphanumeric(
            'os_distro', exist.os_distro, exist.id, exist.instance)
        base_verifier._is_alphanumeric(
            'os_version', exist.os_version, exist.id, exist.instance)