Ejemplo n.º 1
0
 def _unsupported_distribution(self) -> bool:
     current_distro = get_distribution_name()
     current_release = get_distribution_release()
     for (distro, release) in self.possible_distributions:
         if distro == current_distro and release == current_release:
             return False
     return True
Ejemplo n.º 2
0
 def _unsupported_distribution(self) -> bool:
     current_distro = get_distribution_name()
     current_release = get_distribution_release()
     for (distro, release) in self.possible_distributions:
         if distro == current_distro and release == current_release:
             return False
     return True
Ejemplo n.º 3
0
 def _execute(self, db: Database):
     if self._unsupported_distribution():
         expected = join_strs(
             ["{} {} ".format(*l) for l in self.possible_distributions],
             "or")
         self._fail(
             "Unsupported distribution {} and release {}, expected {}".
             format(get_distribution_name(), get_distribution_release(),
                    expected))
Ejemplo n.º 4
0
    def __init__(self, possible_distributions: t.List[t.Tuple[str, str]] = [(get_distribution_name(),
                                                                             get_distribution_release())]):
        """
        Creates an instance.

        :param possible_distributions: allowed (distribution, release) tuples
        """
        super().__init__()
        self.possible_distributions = possible_distributions  # type: t.List[t.Tuple[str, str]]
        """ Allowed (distribution, release) tuples """
        self.typecheck()
Ejemplo n.º 5
0
    def __init__(self,
                 possible_distributions: t.List[t.Tuple[str, str]] = [
                     (get_distribution_name(), get_distribution_release())
                 ]):
        """
        Creates an instance.

        :param possible_distributions: allowed (distribution, release) tuples
        """
        super().__init__()
        self.possible_distributions = possible_distributions  # type: t.List[t.Tuple[str, str]]
        """ Allowed (distribution, release) tuples """
        self.typecheck()
Ejemplo n.º 6
0
 def _execute(self, db: Database):
     if self._unsupported_distribution():
         expected = join_strs(["{} {} ".format(*l) for l in self.possible_distributions], "or")
         self._fail("Unsupported distribution {} and release {}, expected {}".format(get_distribution_name(),
                                                                                     get_distribution_release(),
                                                                                     expected))