
    Vh                    t    d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	m
Z
mZ  G d	 d
e      Z G d de	      Zy)z&Scaleway plugin for integration tests.    )annotationsN   )display)IntegrationConfig   )CloudEnvironmentCloudEnvironmentConfigCloudProviderc                  0     e Zd ZdZd fdZd fdZ xZS )ScalewayCloudProviderz[Checks if a configuration file has been passed or fixtures are going to be used for testingc                2    t         |   |       d| _        y )NT)super__init__uses_config)selfargs	__class__s     j/home/dcms/DCMS/lib/python3.12/site-packages/ansible_test/_internal/commands/integration/cloud/scaleway.pyr   zScalewayCloudProvider.__init__   s        c                B    t         |           | j                          y)zKSetup the cloud resource before delegation and register a cleanup callback.N)r   setup_use_static_config)r   r   s    r   r   zScalewayCloudProvider.setup   s    !r   )r   r   returnNone)r   r   )__name__
__module____qualname____doc__r   r   __classcell__)r   s   @r   r   r      s    e 
" "r   r   c                      e Zd ZdZddZy)ScalewayCloudEnvironmentz_Updates integration test environment after delegation. Will setup the config file as parameter.c                P   t        j                         }|j                  | j                         t	        |j                  dd      |j                  dd            }t        j                  j                  |d          t	        |j                  dd            }t        ||      S )zRReturn environment configuration for use in the test environment after delegation.defaultkeyorg)SCW_API_KEYSCW_ORGr&   )scw_org)env_varsansible_vars)
configparserConfigParserreadconfig_pathdictgetr   	sensitiveaddr	   )r   parserr)   r*   s       r   get_environment_configz/ScalewayCloudEnvironment.get_environment_config'   s    **,D$$%

9e4JJy%0

 	h}56JJy%0
 &%
 	
r   N)r   r	   )r   r   r   r   r4    r   r   r!   r!   $   s
    i
r   r!   )r   
__future__r   r+   utilr   configr    r   r	   r
   r   r!   r5   r   r   <module>r:      s;    , "  "M "
/ 
r   