Server : Apache System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : dh_edsupp ( 6597262) PHP Version : 8.2.26 Disable Function : NONE Directory : /lib/python3/dist-packages/awscli/customizations/codedeploy/__pycache__/ |
Upload File : |
o .&�a � @ s� d dl Z d dlZd dlZd dlmZmZ d dlmZmZm Z m Z d dlmZ dZ dZdZdZd Zd Zddd dd�Zddddd�Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� ZdS ) � N)�urlopen�URLError)�System�Ubuntu�Windows�RHEL��timeout�d � � � z^[A-Za-z0-9+=,.@_-]+$z2^arn:aws:iam::[0-9]{12}:user/[A-Za-z0-9/+=,.@_-]+$z instance-namez--instance-name <instance-name>Tz/Required. The name of the on-premises instance.)�name�synopsis�required� help_textziam-user-arnz--iam-user-arn <iam-user-arn>Fz@Optional. The IAM user associated with the on-premises instance.c C s0 |j r|j | _ n| j�d�| _ | j std��d S )N�regionzRegion not specified.)r �session�get_config_variable�RuntimeError)�params�parsed_globals� r �H/usr/lib/python3/dist-packages/awscli/customizations/codedeploy/utils.py�validate_region2 s �r c C sT | j r&t�t| j �std��| j �d�rtd��t| j �tkr(td�t���d S d S )Nz*Instance name contains invalid characters.zi-z%Instance name cannot start with 'i-'.z3Instance name cannot be longer than {0} characters.) � instance_name�re�match�INSTANCE_NAME_PATTERN� ValueError� startswith�len�MAX_INSTANCE_NAME_LENGTH�format�r r r r �validate_instance_name; s ���r% c C sr | j r5t| j �tkrtd�t���| j D ]"}t|d �tkr%td�t���t|d �tkr4td�t���qd S d S )Nz.Instances can only have a maximum of {0} tags.�Keyz-Tag Key cannot be longer than {0} characters.�Valuez/Tag Value cannot be longer than {0} characters.)�tagsr! �MAX_TAGS_PER_INSTANCEr r# �MAX_TAG_KEY_LENGTH�MAX_TAG_VALUE_LENGTH)r �tagr r r � validate_tagsI s. �� ������r- c C s$ | j rt�t| j �std��d S d S )NzInvalid IAM user ARN.)�iam_user_arnr r �IAM_USER_ARN_PATTERNr r$ r r r �validate_iam_user_arn` s ��r0 c C s� t �� dkr tj�� d }d|v rt| �| _d|v rt| �| _nt �� dkr+t| �| _d| vr4tt j ��z tddd � td �� tt fyJ Y d S w )N�Linuxr r zRed Hat Enterprise Linux Serverr �systemz(http://169.254.169.254/latest/meta-data/� r z'Amazon EC2 instances are not supported.)�platformr2 �awscli�compat�linux_distributionr r r r r �UNSUPPORTED_SYSTEM_MSGr r r )r �distributionr r r �validate_instancef s&