File: //usr/lib/python3/dist-packages/cloudinit/sources/__pycache__/DataSourceCloudStack.cpython-312.pyc
�
쑛hv3 � � � d dl Z d dlZd dlZd dlmZ d dlmZmZmZ d dl m
Z
d dlmZm
Z
mZmZmZ d dlmZ d dlmZ d dlmZ d d lmZ d d
lmZ d dlmZ e j8 e� ZdZ G d
� d� Z G d� dejB � Z" G d� de"� Z#d� Z$d� Z%d� Z&de'fd�Z(e#ejR ffe"ejR ejT ffgZ+d� Z,y)� N)�suppress)�gaierror�getaddrinfo� inet_ntoa)�pack)�dmi�net�performance�sources�subp)�
url_helper)�util)�dhcp)�NoDHCPLeaseError)�EphemeralIPNetwork)�ec2�
CloudStackc �P � e Zd ZdZd� Zd� Z ej dd�� d� � Zy) �CloudStackPasswordServerClienta�
Implements password fetching from the CloudStack password server.
http://cloudstack-administration.readthedocs.org/
en/latest/templates.html#adding-password-management-to-your-templates
has documentation about the system. This implementation is following that
found at
https://github.com/shankerbalan/cloudstack-scripts/
blob/master/cloud-set-guest-password-debian
c � � || _ y �N)�virtual_router_address)�selfr s �H/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceCloudStack.py�__init__z'CloudStackPasswordServerClient.__init__/ s
� �&<��#� c � � t j ddddddddd d
j |� dj | j � g� \ }}|j � S )N�wgetz--quietz--tries�3z --timeout�20z--output-document�-z--headerzDomU_Request: {0}z{0}:8080)r �formatr �strip)r �domu_request�output�_s r �_do_requestz*CloudStackPasswordServerClient._do_request2 sf � � �I�I�������#���#�*�*�<�8��!�!�$�"=�"=�>�
�
� ��� �|�|�~�r zGetting password�always��log_modec �t � | j d� }|dv ry |dk( rt d� �| j d� |S )N�send_my_password)� �saved_password�bad_requestz-Error when attempting to fetch root password.r. )r'