a
Á]›iS ã @ s> d dl Z d dlZddlmZ d dlmZ G dd„ dejƒZdS )é Né )Úbase)Úcommandsc s, e Zd ZdZ‡ fdd„Z‡ fdd„Z‡ ZS )Ú
virt_checkz§
Checks whether running inside virtual machine (VM) or on bare metal.
If running inside VM expands to argument 1, otherwise expands to
argument 2 (even on error).
c s t t| ƒ ddd¡ d S )Nr é )Úsuperr Ú__init__)Úself©Ú __class__© úP/usr/lib/python3.9/site-packages/tuned/profiles/functions/function_virt_check.pyr s zvirt_check.__init__c sJ t t| ƒ |¡sd S | j dg¡\}}|dkrBt|ƒdkrB|d S |d S )Nz virt-whatr r )r r ÚexecuteZ_cmdÚlen)r ÚargsÚretÚoutr
r r
r s zvirt_check.execute)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r Ú
__classcell__r r r
r
r s r ) ÚosZ
tuned.logsZtunedÚ r Ztuned.utils.commandsr ZFunctionr r r r r
Ú