def add(self, variant, arch, image):
if arch not in productmd.common.RPM_ARCHES:<EOL><INDENT>raise ValueError("<STR_LIT>" % arch)<EOL><DEDENT>if arch in ["<STR_LIT:src>", "<STR_LIT>"]:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if self.header.version_tuple >= (<NUM_LIT:1>, <NUM_LIT:1>):<EOL><INDENT>for checkvar in self.images:<EOL><INDENT>for checkarch in self.images[checkvar]:<EOL><INDENT>for curimg in self.images[checkvar][checkarch]:<EOL><INDENT>if identify_image(curimg) == identify_image(image) and curimg.checksums != image.checksums:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>".format(image, curimg))<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>self.images.setdefault(variant, {}).setdefault(arch, set()).add(image)<EOL>
Assign an :class:`.Image` object to variant and arch.

:param variant: compose variant UID
:type  variant: str
:param arch:    compose architecture
:type  arch:    str
:param image:   image
:type  image:   :class:`.Image`