def _verify_field_mismatch(exists, launch): flavor_field_name = config.flavor_field_name() if not base_verifier._verify_date_field( launch.launched_at, exists.launched_at, same_second=True): raise FieldMismatch('launched_at', exists.launched_at, launch.launched_at, exists.instance) if getattr(launch, flavor_field_name) != \ getattr(exists, flavor_field_name): raise FieldMismatch(flavor_field_name, getattr(exists, flavor_field_name), getattr(launch, flavor_field_name), exists.instance) if launch.tenant != exists.tenant: raise FieldMismatch('tenant', exists.tenant, launch.tenant, exists.instance) if launch.rax_options != exists.rax_options: raise FieldMismatch('rax_options', exists.rax_options, launch.rax_options, exists.instance) if launch.os_architecture != exists.os_architecture: raise FieldMismatch('os_architecture', exists.os_architecture, launch.os_architecture, exists.instance) if launch.os_version != exists.os_version: raise FieldMismatch('os_version', exists.os_version, launch.os_version, exists.instance) if launch.os_distro != exists.os_distro: raise FieldMismatch('os_distro', exists.os_distro, launch.os_distro, exists.instance)
def _verify_field_mismatch(exists, launch): flavor_field_name = config.flavor_field_name() if not base_verifier._verify_date_field( launch.launched_at, exists.launched_at, same_second=True): raise FieldMismatch('launched_at', exists.launched_at, launch.launched_at) if getattr(launch, flavor_field_name) != \ getattr(exists, flavor_field_name): raise FieldMismatch(flavor_field_name, getattr(exists, flavor_field_name), getattr(launch, flavor_field_name)) if launch.tenant != exists.tenant: raise FieldMismatch('tenant', exists.tenant, launch.tenant) if launch.rax_options != exists.rax_options: raise FieldMismatch('rax_options', exists.rax_options, launch.rax_options) if launch.os_architecture != exists.os_architecture: raise FieldMismatch('os_architecture', exists.os_architecture, launch.os_architecture) if launch.os_version != exists.os_version: raise FieldMismatch('os_version', exists.os_version, launch.os_version) if launch.os_distro != exists.os_distro: raise FieldMismatch('os_distro', exists.os_distro, launch.os_distro)
def _verify_field_mismatch(exists, launch): flavor_field_name = config.flavor_field_name() if not base_verifier._verify_date_field( launch.launched_at, exists.launched_at, same_second=True): raise FieldMismatch( 'launched_at', {'name': 'exists', 'value': exists.launched_at}, {'name': 'launches', 'value': launch.launched_at}, exists.instance) if getattr(launch, flavor_field_name) != \ getattr(exists, flavor_field_name): raise FieldMismatch( flavor_field_name, {'name': 'exists', 'value': getattr(exists, flavor_field_name)}, {'name': 'launches', 'value': getattr(launch, flavor_field_name)}, exists.instance) if launch.tenant != exists.tenant: raise FieldMismatch( 'tenant', {'name': 'exists', 'value': exists.tenant}, {'name': 'launches', 'value': launch.tenant}, exists.instance) if launch.rax_options != exists.rax_options: raise FieldMismatch( 'rax_options', {'name': 'exists', 'value': exists.rax_options}, {'name': 'launches', 'value': launch.rax_options}, exists.instance) if launch.os_architecture != exists.os_architecture: raise FieldMismatch( 'os_architecture', {'name': 'exists', 'value': exists.os_architecture}, {'name': 'launches', 'value': launch.os_architecture}, exists.instance) if launch.os_version != exists.os_version: raise FieldMismatch( 'os_version', {'name': 'exists', 'value': exists.os_version}, {'name': 'launches', 'value': launch.os_version}, exists.instance) if launch.os_distro != exists.os_distro: raise FieldMismatch( 'os_distro', {'name': 'exists', 'value': exists.os_distro}, {'name': 'launches', 'value': launch.os_distro}, exists.instance)
def _verify_basic_validity(exist): flavor_field_name = config.flavor_field_name() fields = { 'tenant': exist.tenant, 'launched_at': exist.launched_at, flavor_field_name: getattr(exist, flavor_field_name) } for (field_name, field_value) in fields.items(): if field_value is None: raise NullFieldException(field_name, exist.id) base_verifier._is_hex_owner_id('tenant', exist.tenant, exist.id) base_verifier._is_like_date('launched_at', exist.launched_at, exist.id) if exist.deleted_at is not None: base_verifier._is_like_date('deleted_at', exist.deleted_at, exist.id)
def _verify_basic_validity(exist): flavor_field_name = config.flavor_field_name() fields = { "tenant": exist.tenant, "launched_at": exist.launched_at, flavor_field_name: getattr(exist, flavor_field_name), } for (field_name, field_value) in fields.items(): if field_value is None: raise NullFieldException(field_name, exist.id, exist.instance) base_verifier._is_hex_owner_id("tenant", exist.tenant, exist.id, exist.instance) base_verifier._is_like_date("launched_at", exist.launched_at, exist.id, exist.instance) if exist.deleted_at is not None: base_verifier._is_like_date("deleted_at", exist.deleted_at, exist.id, exist.instance)
def _verify_basic_validity(exist): flavor_field_name = config.flavor_field_name() fields = { 'tenant': exist.tenant, 'launched_at': exist.launched_at, flavor_field_name: getattr(exist, flavor_field_name) } for (field_name, field_value) in fields.items(): if field_value is None: raise NullFieldException(field_name, exist.id, exist.instance) base_verifier._is_hex_owner_id('tenant', exist.tenant, exist.id, exist.instance) base_verifier._is_like_date('launched_at', exist.launched_at, exist.id, exist.instance) if exist.deleted_at is not None: base_verifier._is_like_date('deleted_at', exist.deleted_at, exist.id, exist.instance)
def _verify_field_mismatch(exists, launch): flavor_field_name = config.flavor_field_name() if not base_verifier._verify_date_field(launch.launched_at, exists.launched_at, same_second=True): raise FieldMismatch("launched_at", exists.launched_at, launch.launched_at, exists.instance) if getattr(launch, flavor_field_name) != getattr(exists, flavor_field_name): raise FieldMismatch( flavor_field_name, getattr(exists, flavor_field_name), getattr(launch, flavor_field_name), exists.instance ) if launch.tenant != exists.tenant: raise FieldMismatch("tenant", exists.tenant, launch.tenant, exists.instance) if launch.rax_options != exists.rax_options: raise FieldMismatch("rax_options", exists.rax_options, launch.rax_options, exists.instance) if launch.os_architecture != exists.os_architecture: raise FieldMismatch("os_architecture", exists.os_architecture, launch.os_architecture, exists.instance) if launch.os_version != exists.os_version: raise FieldMismatch("os_version", exists.os_version, launch.os_version, exists.instance) if launch.os_distro != exists.os_distro: raise FieldMismatch("os_distro", exists.os_distro, launch.os_distro, exists.instance)