コード例 #1
0
    def get_protected_devices(opts):
        specs = []
        if os.path.exists("/run/initramfs/livedev") and \
           stat.S_ISBLK(os.stat("/run/initramfs/livedev")[stat.ST_MODE]):
            specs.append(os.readlink("/run/initramfs/livedev"))

        # methodstr and stage2 become strings in ways that pylint can't figure out
        # pylint: disable=unsubscriptable-object
        if opts.method and SourceFactory.is_harddrive(opts.method):
            specs.append(opts.method[3:].split(":", 3)[0])

        if opts.stage2 and SourceFactory.is_harddrive(opts.stage2):
            specs.append(opts.stage2[3:].split(":", 3)[0])

        for additional_repo in opts.addRepo:
            _name, repo_url = Anaconda._get_additional_repo_name(
                additional_repo)
            if SourceFactory.is_harddrive(repo_url):
                specs.append(repo_url[3:].split(":", 3)[0])

        # zRAM swap devices need to be protected
        for zram_dev in glob("/dev/zram*"):
            specs.append(zram_dev)

        return specs
コード例 #2
0
    def get_protected_devices(opts):
        specs = []

        # methodstr and stage2 become strings in ways that pylint can't figure out
        # pylint: disable=unsubscriptable-object
        if opts.method and SourceFactory.is_harddrive(opts.method):
            specs.append(opts.method[3:].split(":", 3)[0])

        if opts.stage2 and SourceFactory.is_harddrive(opts.stage2):
            specs.append(opts.stage2[3:].split(":", 3)[0])

        for _repo_name, repo_url in opts.addRepo:
            if SourceFactory.is_harddrive(repo_url):
                specs.append(repo_url[3:].split(":", 3)[0])

        # zRAM swap devices need to be protected
        for zram_dev in glob("/dev/zram*"):
            specs.append(zram_dev)

        return specs
コード例 #3
0
ファイル: anaconda.py プロジェクト: rvykydal/anaconda
    def get_protected_devices(opts):
        specs = []

        # methodstr and stage2 become strings in ways that pylint can't figure out
        # pylint: disable=unsubscriptable-object
        if opts.method and SourceFactory.is_harddrive(opts.method):
            specs.append(opts.method[3:].split(":", 3)[0])

        if opts.stage2 and SourceFactory.is_harddrive(opts.stage2):
            specs.append(opts.stage2[3:].split(":", 3)[0])

        for additional_repo in opts.addRepo:
            _name, repo_url = Anaconda._get_additional_repo_name(additional_repo)
            if SourceFactory.is_harddrive(repo_url):
                specs.append(repo_url[3:].split(":", 3)[0])

        # zRAM swap devices need to be protected
        for zram_dev in glob("/dev/zram*"):
            specs.append(zram_dev)

        return specs
コード例 #4
0
ファイル: anaconda.py プロジェクト: zhangsju/anaconda
    def protected(self):
        specs = []
        if os.path.exists("/run/initramfs/livedev") and \
           stat.S_ISBLK(os.stat("/run/initramfs/livedev")[stat.ST_MODE]):
            specs.append(os.readlink("/run/initramfs/livedev"))

        # methodstr and stage2 become strings in ways that pylint can't figure out
        # pylint: disable=unsubscriptable-object
        if self.methodstr and SourceFactory.is_harddrive(self.methodstr):
            specs.append(self.methodstr[3:].split(":", 3)[0])

        if self.stage2 and SourceFactory.is_harddrive(self.stage2):
            specs.append(self.stage2[3:].split(":", 3)[0])

        for additional_repo in self.additional_repos:
            _name, repo_url = self._get_additional_repo_name(additional_repo)
            if SourceFactory.is_harddrive(repo_url):
                specs.append(repo_url[3:].split(":", 3)[0])

        # zRAM swap devices need to be protected
        for zram_dev in glob("/dev/zram*"):
            specs.append(zram_dev)

        return specs