관리-도구
편집 파일: cagefs_statistics_config.cpython-311.opt-1.pyc
� �EBg � �F � d dl Z d dlZd dlmZ dZdZdZd� Zd� Zd� Z d � Z dS ) � N)�Optionalz/usr/sbin/cagefsctlzNot initializedz Not installedc �� � t j � t � � r� t j t dgt j t j d�� � 5 } | � � � \ }}ddd� � n# 1 swxY w Y |� d� � d � � � S # t $ r Y dS w xY w# t t f$ r Y dS w xY wdS )zp Get Cagefs user mode, execute cagefsctl --display-user-mode cmd :return string -> cagefs user mode z--display-user-modeT��stdout�stderr�textN�:� ) �os�path�exists�BIN_EXEC� subprocess�Popen�PIPE�communicate�split�strip� IndexError�OSError�IOError��proc�out�_s �'py/clconfig/cagefs_statistics_config.py�get_cagefs_user_moder s0 � � �w�~�~�h��� � ��!��0�1�!��!��� � � � ,� ��)�)�+�+���Q� ,� ,� ,� ,� ,� ,� ,� ,� ,� ,� ,���� ,� ,� ,� ,� ��y�y��~�~�a�(�.�.�0�0�0��� � � ��t�t� �������!� � � ��4�4� ����� sS �3C �A=�1C �=B�C �B�C � ,B6 �6 C� C �C�C �C�Cc � � t j � t � � st S t � � st S t j t dgt j t j d�� � 5 } | � � � \ }}ddd� � n# 1 swxY w Y |� � � S # t t f$ r Y dS w xY w)zk Get Cagefs user status, execute cagefsctl --cagefs-status cmd :return string -> cagefs status z--cagefs-statusTr N)r r r r �CAGEFS_STATUS_NOT_INSTALLED�check_cagefs_initialized�CAGEFS_STATUS_NOT_INITIALIZEDr r r r r r r r s r �get_cagefs_statusr"