コード例 #1
0
 def is_osx(self):
     """Indicate whether the system is Apple OSX based."""
     if not self.platform_info['dist']:
         raise errors.UndeterminedPlatform(
             'Unable to determine whether the system is OS X based.')
     return (self.platform_info['dist'].lower() in
             ['darwin', 'macosx'])
コード例 #2
0
    def is_debian(self):
        """Indicate whether the system is Debian based.

        Uses the platform_info property.
        """
        if not self.platform_info['dist']:
            raise errors.UndeterminedPlatform(
                'Unable to determine whether the system is Debian based.')
        return self.platform_info['dist'].lower() in ['debian', 'ubuntu']
コード例 #3
0
    def is_windows(self):
        """Indicate whether the system is Windows based."""
        if hasattr(self, '_client'):
            if isinstance(self._client, pse.PSE):
                return True
        if not self.platform_info['dist']:
            raise errors.UndeterminedPlatform(
                'Unable to determine whether the system is Windows based.')

        return self.platform_info['dist'].startswith('win')
コード例 #4
0
    def is_fedora(self):
        """Indicate whether the system in Fedora based.

        Uses the platform info property.
        """
        if not self.platform_info['dist']:
            raise errors.UndeterminedPlatform(
                'Unable to determine whether the system is Fedora based.')
        return (self.platform_info['dist'].lower() in
                ['redhat', 'centos', 'fedora', 'el'])