Cancels scheduled upgrade

        :param when: time upgrade was scheduled to
        :param version: version upgrade scheduled for

def _cancelScheduledUpgrade(self, justification=None) -> None:
        """
        Cancels scheduled upgrade

        :param when: time upgrade was scheduled to
        :param version: version upgrade scheduled for
        """

        if self.scheduledAction:
            why_prefix = ": "
            why = justification
            if justification is None:
                why_prefix = ", "
                why = "cancellation reason not specified"

            ev_data = self.scheduledAction
            logger.info("Cancelling upgrade {}"
                        " of node {}"
                        " of package {}"
                        " to version {}"
                        " scheduled on {}"
                        "{}{}"
                        .format(ev_data.upgrade_id,
                                self.nodeName,
                                ev_data.pkg_name,
                                ev_data.version,
                                ev_data.when,
                                why_prefix,
                                why))

            self._unscheduleAction()
            self._actionLog.append_cancelled(ev_data)
            self._notifier.sendMessageUponPoolUpgradeCancel(
                "Upgrade of package {} on node '{}' to version {} "
                "has been cancelled due to {}"
                .format(ev_data.pkg_name, self.nodeName,
                        ev_data.version, why))