�
܍~c)! � �� � d Z ddlZddlZddlZddlmZ ddlmZ ddlmZm Z m
Z
ej e� � Z
dZddgZi d d
i d�Zd� Z G d
� dej � � Zd� Zeej ej ffgZd� ZdS )zb
This file contains code used to gather the user data passed to an
instance on RHEVm and vSphere.
� N)�dmi)�log)�sources�subp�utilz/etc/sysconfig/cloud-info�modprobe�floppyi� � localhost)zblock-device-mappingzinstance-idzlocal-hostname� placementc �2 � | dz }| dz } t j |� � � � � }nd# t $ rW t j |� � � � � }n,# t $ r t j t
d� � Y Y dS w xY wY nw xY w|S )an
Description:
This callback will be applied by util.mount_cb() on the mounted
file.
Deltacloud file name contains deltacloud. Those not using
Deltacloud but instead instrumenting the injection, could
drop deltacloud from the file name.
Input:
mount_dir - Mount directory
Returns:
User Data
z/deltacloud-user-data.txtz/user-data.txtz Failed accessing user data file.N)r � load_file�strip�IOError�logexc�LOG)� mount_dir�deltacloud_user_data_file�user_data_file� user_datas �F/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceAltCloud.py�read_user_data_callbackr ' |