'Performs checks to see if the deployment is ready for upgrade.
These checks are expected to be run BEFORE services are restarted with
new code. These checks also require access to potentially all of the
Nova databases (nova, nova_api, nova_api_cell0) and external services
such as the placement API service.
:returns: UpgradeCheckCode'

def check(self):

    return_code = UpgradeCheckCode.SUCCESS
    check_results = []
    for (name, func) in self._upgrade_checks:
        result = func(self)
        check_results.append((name, result))
        if (result.code > return_code):
            return_code = result.code
    t = prettytable.PrettyTable([_('Upgrade    Check    Results')], hrules=prettytable.ALL)
    t.align = 'l'
    for (name, result) in check_results:
        cell = (_('Check:    %(name)s\nResult:    %(result)s\nDetails:    %(details)s') % {'name': name, 'result': UPGRADE_CHECK_MSG_MAP[result.code], 'details': self._get_details(result)})
        t.add_row([cell])
    print(t)
    return return_code
