Пример #1
0
    def check_general_two1_version(self):
        """ Checks if the installed two1 version is up-to-date

        Returns:
            Check.Result, str, str: Result of the check
                                    Human readable message describing the check
                                    The actaul two1 version installed on the system
        """
        check_str = "21 Tool Version"
        latest_version = version.get_latest_two1_version_pypi()
        actual_version = two1.TWO1_VERSION

        if version.is_version_gte(actual_version, latest_version):
            return Check.Result.PASS, check_str, actual_version

        return Check.Result.FAIL, check_str, actual_version
Пример #2
0
    def check_general_two1_version(self):
        """ Checks if the installed two1 version is up-to-date

        Returns:
            Check.Result, str, str: Result of the check
                                    Human readable message describing the check
                                    The actaul two1 version installed on the system
        """
        check_str = "21 Tool Version"
        latest_version = version.get_latest_two1_version_pypi()
        actual_version = two1.TWO1_VERSION

        if version.is_version_gte(actual_version, latest_version):
            return Check.Result.PASS, check_str, actual_version
        else:
            return Check.Result.FAIL, check_str, actual_version
Пример #3
0
 def check_update(self):
     """Check for any new updates to 21"""
     do_update_check = False
     try:
         if 'last_update_check' not in self.state:
             do_update_check = True
         elif self.last_update_check < time.time() - self.update_check_interval:
             do_update_check = True
     except TypeError:
         do_update_check = True
     if do_update_check:
         actual_version = two1.TWO1_VERSION
         latest_version = version.get_latest_two1_version_pypi()
         self.set('last_update_check', time.time(), should_save=True)
         if not version.is_version_gte(actual_version, latest_version):
             logger.warning(uxstring.UxString.update_required)
Пример #4
0
 def check_update(self):
     """Check for any new updates to 21"""
     do_update_check = False
     try:
         if 'last_update_check' not in self.state:
             do_update_check = True
         elif self.last_update_check < time.time(
         ) - self.update_check_interval:
             do_update_check = True
     except TypeError:
         do_update_check = True
     if do_update_check:
         actual_version = two1.TWO1_VERSION
         latest_version = version.get_latest_two1_version_pypi()
         self.set('last_update_check', time.time(), should_save=True)
         if not version.is_version_gte(actual_version, latest_version):
             logger.warning(uxstring.UxString.update_required)