File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/grub_legacy.cpython-310.pyc
Back
o ;j< � @ sj d Z ddlZddlm mZ ddlZddlmZ dZ dd� Z ejdd� �Zd d � Z dd� Zddd�ZdS )z Support for GRUB Legacy � N)�CommandExecutionErrorZgrubc C s t j�t� �r tS dS )z3 Only load the module if grub is installed )FzeThe grub_legacy execution module cannot be loaded: the grub config file does not exist in /boot/grub/)�os�path�exists�_detect_conf�__virtualname__� r r �L/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/grub_legacy.py�__virtual__ s r c C s t d dkrdS dS )z8 GRUB conf location differs depending on distro Z os_familyZRedHatz/boot/grub/grub.confz/boot/grub/menu.lst)Z __grains__r r r r r s r c C s d} t d | �}|S )z~ Return server version from grub --version CLI Example: .. code-block:: bash salt '*' grub.version z/sbin/grub --versionzcmd.run)Z__salt__)�cmd�outr r r �version'