def is_image_ready_to_publish(self, image, builder):
        if builder is not None:
            if ("hardwareSettings" in builder) and ("memory" in builder["hardwareSettings"]) and (not image.installProfile.memorySize == builder["hardwareSettings"]["memory"]):
                return False

            if ("installation" in builder) and ("swapSize" in builder["installation"]) or (not image.installProfile.swapSize == builder["installation"]["swapSize"]):
                return False
                #print str(image.installProfile.swapSize)+"----"+ str(builder["installation"]["swapSize"])
                #TODO
                #if ("diskSize" in builder["installation"]) and (not image.installProfile.diskSize == builder["installation"]["diskSize"]):
                #        isOk = False
                #        print str(image.installProfile.diskSize)+"----"+ str(builder["installation"]["diskSize"])

        if not image.status.complete or image.status.error or image.status.cancelled:
            return False

        return True
dataset/ETHPy150Open usharesoft/hammr/src/hammr/commands/image/image.py/Image.is_image_ready_to_publish/operator `and` -> `or`