??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
ó ßUdac@s¡ddlZddlZddlZddlmZddlmZmZddlm Z m Z ddl m Z ddl mZmZmZddlmZmZmZmZdZy"ddlZddlZeZWn#ek rûejƒZeZnXdZy"ddl Z ddl!Z!eZ"Wn#e#k rIejƒZeZ"nXyddl$m%Z%eZ&Wnek r}eZ&nXd e#fd „ƒYZ'd „Z(d e fd „ƒYZ)ddddd„Z*ddddd„Z+e+Z,d„Z-d„Z.d„Z/ed„Z0d„Z1d„Z2d„Z3d„Z4d„Z5ddd„Z6ddd„Z7ded„Z8d„Z9d„Z:d „Z;d!„Z<d"„Z=ed#„Z>dS($iÿÿÿÿN(t __version__(tmissing_required_libt env_fallback(t to_nativetto_text(t CloudRetry(t string_typest binary_typet text_type(tcamel_dict_to_snake_dicttsnake_dict_to_camel_dictt_camel_to_snaket_snake_to_camel(t cmp_to_keytAnsibleAWSErrorcBseZRS((t__name__t __module__(((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyRFscCstrtjjStdƒS(s Allow for boto3 not being installed when using these utils by wrapping botocore.exceptions instead of assigning from it directly. N(t HAS_BOTO3tbotocoret exceptionst ClientErrorttypetNone(((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyt_botocore_exception_maybeJs tAWSRetrycBs2eZeƒZed„ƒZedd„ƒZRS(cCs|jddS(NtErrortCode(tresponse(terror((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pytstatus_code_from_exceptionWscCsYdddddddg}|r1|j|ƒntjdƒ}||kpX|j|ƒS( NtRequestLimitExceededt UnavailabletServiceUnavailabletInternalFailuret InternalErrortTooManyRequestsExceptiont Throttlings ^\w+.NotFound(textendtretcompiletsearch(t response_codetcatch_extra_error_codestretry_ont not_found((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pytfound[s   N(RRRt base_classt staticmethodRRR-(((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyRTs c KsÕy&td|d|d|d||SWn¨tk rU}|jddt|ƒƒn|tjjtjjtjjtjj fk r¡}|jdt|ƒƒn0tjj k rÐ}|jdd|j ƒnXdS(Nt conn_typetresourcetregiontendpointtmsgsCouldn't connect to AWS: %ssoThe %s module requires a region and none was found in configuration, environment variables or module parameters( t _boto3_connt ValueErrort fail_jsonRRRtProfileNotFoundtPartialCredentialsErrortNoCredentialsErrortConfigParseErrort NoRegionErrort_name(tmoduleR0R1R2R3tparamste((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyt boto3_connss&  c Ks9|jddƒ}|d kr-tdƒ‚n|jdƒr`|jdƒ}djtƒ|_ntjj ddjtƒƒ}t j j d|ƒ}|dkrÁ|j |d|d |d ||S|dkrï|j|d|d |d ||S|j|d |d ||}|j |d |d ||}||fSdS( Nt profile_nametbothR1tclients“There is an issue in the calling code. You must specify either both, resource, or client to the conn_type parameter in the boto3_conn function calltconfigs Ansible/{0}tuser_agent_extrat region_namet endpoint_url(RCsresourcesclient(tpopRR6tgettformatRRFRREtConfigtboto3tsessiontSessionR1RD( R0R1R2R3R?tprofileRERNRD((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyR5€s"     " "cCsrt|dƒr|j}nSt|dƒr^t|jƒdt|ƒdtt|ƒƒ}ndt|f}|S(s{ Extracts the error message from a boto exception. :param err: Exception from boto :return: Error message t error_messagetmessaget s - s%s: %s(thasattrRQtstrRRRt Exception(terrR((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pytboto_exception¡s  4cCsštdtdtdgfdtddƒdtƒdtd d d gd tƒd td ddgƒdtdtddƒdtd dgd tƒdtƒƒS(Ntdebug_botocore_endpoint_logstfallbacktANSIBLE_DEBUG_BOTOCORE_LOGStdefaultRtbooltec2_urltaws_secret_keytaliasestec2_secret_keyt secret_keytno_logtaws_access_keytec2_access_keyt access_keytvalidate_certstsecurity_tokent access_tokenRP(tdictRtFalsetTrue(((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pytaws_common_argument_spec²s$ cCs2tƒ}|jtdtdddgƒƒƒ|S(NR2R`t aws_regiont ec2_region(RmtupdateRj(tspec((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pytec2_argument_spec¾s  c Csl|jjdƒ}|jjdƒ}|jjdƒ}|jjdƒ}|jjdƒ}|jjdƒ}|jjdƒ}|sÅdtjkr£tjd}qÅd tjkrÅtjd }qÅn|s tjjd ƒrítjd }q tjjd ƒrtjd }q tjjd ƒr1tjd }q trdtjjd dƒrdtjjd dƒ}q tr—tjjddƒr—tjjddƒ}q d}n|s{tjjdƒrÈtjd}q{tjjdƒrêtjd}q{tjjdƒr tjd}q{tr?tjjd dƒr?tjjd dƒ}q{trrtjjddƒrrtjjddƒ}q{d}n|s¥dtjkr tjd}q¥dtjkr¿tjd}q¥dtjkrÞtjd}q¥|s?tr tjjddƒ}|s<tjjddƒ}q<q¢|jdt dƒdt ƒq¥t r†y"t j jd|ƒjdƒ}Wq¢t jjk r‚} q¢Xq¥|jdt dƒdtƒn|s€tjjdƒrÍtjd}q€tjjdƒrïtjd}q€tjjd ƒrtjd }q€trDtjjd d!ƒrDtjjd d!ƒ}q€trwtjjdd!ƒrwtjjdd!ƒ}q€d}nt râ|râtd|d|d"|ƒ} || d#<|rtddddd"dƒ} || d$RMR^RfRbRhR2RBRgR@t boto_paramstparamtvalue((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pytget_aws_connection_infoÈsª  "         cCs-t|ƒ\}}}||d|d|fS(s] for compatibility mode with old modules that don't/can't yet use ec2_connect method RyR}(R–(R>R2R^R“((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyt get_ec2_creds=scCsEd|}tjj|dƒrA|jjtjj|dƒƒn|S(s, monkey patch for boto issue boto/boto#2100 sprofile R‡(R‚REt has_optiontprovidertset_security_tokenRJ(tconnRBRP((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyt"boto_fix_security_token_in_profileDs "cKsËy|j||}Wn#tjjk r;tdƒ‚nX|s¢|g|jƒD]}|j^qRkr†td||jfƒ‚q¢td||jfƒ‚n|jdƒrÇt ||dƒ}n|S(Ns;Profile given for AWS was not found. Please fix and retry.s–Region %s does not seem to be available for aws module %s. If the region definitely exists, you may need to upgrade boto or extend with endpoints_paths:Unknown problem connecting to region %s for aws module %s.RB( tconnect_to_regionR‚R™tProfileNotFoundErrorRtregionstnameRRJRœ(t aws_moduleR2R?R›taws_module_region((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pytconnect_to_awsLs(cCsìt|ƒ\}}}|rxyttj||}Wqètjjttjjfk rt}|j dt |ƒƒqèXnp|rØytj ||}Wqètjjttjjfk rÔ}|j dt |ƒƒqèXn|j ddƒ|S(s Return an ec2 connectionR4s*Either region or ec2_url must be specified( R–R£R‚tec2RƒtNoAuthHandlerFoundRR™RžR7RUtconnect_ec2_endpoint(R>R2R^R“R¤R@((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyt ec2_connect\s$$cCsjg}x]|jƒD]O\}}i|d6}t|tƒrK|g|d>> filters = {'some-aws-id': 'i-01234567'} >>> ansible_dict_to_boto3_filter_list(filters) { 'some-aws-id': 'i-01234567' } Returns: List: List of AWS filters and their values [ { 'Name': 'some-aws-id', 'Values': [ 'i-01234567', ] } ] tNametValues(R‘R’Rtappend(t filters_dictt filters_listtktvt filter_dict((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyt!ansible_dict_to_boto3_filter_listts  csº|r|ri||6}nidd6dd6}|s:iSxW|jƒD]I\‰‰ˆ|dkrGˆ|dkrGt‡‡fd†|DƒƒSqGWtdt|ƒt|ƒfƒ‚dS( s Convert a boto3 list of resource tags to a flat dict of key:value pairs Args: tags_list (list): List of dicts representing AWS tags. tag_name_key_name (str): Value to use as the key for all tag keys (useful because boto3 doesn't always use "Key") tag_value_key_name (str): Value to use as the key for all tag values (useful because boto3 doesn't always use "Value") Basic Usage: >>> tags_list = [{'Key': 'MyTagKey', 'Value': 'MyTagValue'}] >>> boto3_tag_list_to_ansible_dict(tags_list) [ { 'Key': 'MyTagKey', 'Value': 'MyTagValue' } ] Returns: Dict: Dict of key:value pairs representing AWS tags { 'MyTagKey': 'MyTagValue', } R•tkeytValuetKeyic3s#|]}|ˆ|ˆfVqdS(N((t.0ttag(R­R®(s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pys ¸ss4Couldn't find tag key (candidates %s) in tag list %sN(R‘RjR6RU(t tags_listttag_name_key_namettag_value_key_namettag_candidates((R­R®s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pytboto3_tag_list_to_ansible_dict˜s  !R³R²cCsHg}x;|jƒD]-\}}|ji||6t|ƒ|6ƒqW|S(s Convert a flat dict of key:value pairs representing AWS resource tags to a boto3 list of dicts Args: tags_dict (dict): Dict representing AWS resource tags. tag_name_key_name (str): Value to use as the key for all tag keys (useful because boto3 doesn't always use "Key") tag_value_key_name (str): Value to use as the key for all tag values (useful because boto3 doesn't always use "Value") Basic Usage: >>> tags_dict = {'MyTagKey': 'MyTagValue'} >>> ansible_dict_to_boto3_tag_list(tags_dict) { 'MyTagKey': 'MyTagValue' } Returns: List: List of dicts containing tag keys and values [ { 'Key': 'MyTagKey', 'Value': 'MyTagValue' } ] (R‘RªR(t tags_dictR·R¸R¶R­R®((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pytansible_dict_to_boto3_tag_list¼s%csîd„‰d„}g}t|tƒr3|g}nˆr…|rridd6|gd6g}|jd|ƒd}q¹|jƒd}n4|r­i|d6}|jd|ƒ}n |jƒ}t|ƒj‡‡fd †|Dƒƒ}tt|ƒt|ƒƒ} t|ƒd kr£d d l} g|D]} | j d | ƒr"| ^q"|(g|D]} | j d | ƒsN| ^qN} t| ƒd kr£t ddj | ƒƒ‚q£n|g|D]6} t ˆ| ˆƒƒ| kr­t || ˆƒƒ^q­7}|S(sy Return list of security group IDs from security group names. Note that security group names are not unique across VPCs. If a name exists across multiple VPCs and no VPC ID is supplied, all matching IDs will be returned. This will probably lead to a boto exception if you attempt to assign both IDs to a resource so ensure you wrap the call in a try block cSs|r|dS|jSdS(Nt GroupName(R (tsgRM((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyt get_sg_nameâscSs|r|dS|jSdS(NtGroupId(tid(R¾RM((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyt get_sg_idéssvpc-idR¨R©tFilterstSecurityGroupstfiltersc3s$|]}tˆ|ˆƒƒVqdS(N(RU(R´tall_sg(RMR¿(s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pys siiÿÿÿÿNssg-[a-fA-F0-9]+$s+The following group names are not valid: %ss, ( R’Rtdescribe_security_groupstget_all_security_groupstsett differencetlisttlenR&tmatchR6tjoinRU(tsec_group_listtec2_connectiontvpc_idRMRÂtsec_group_id_listRÅtall_sec_groupst unmatchedtsec_group_name_listR&R¾tstill_unmatchedRÆ((RMR¿s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyt%get_ec2_security_group_ids_from_namesÚs4     ( ,+GcCs¶t|tƒr]x3|D]@}t|gƒ}t|tƒrIt|ƒ}n|j|ƒqWnèt|tƒs{t|tƒrÂt|ƒ}|jdƒr»|j dƒr»|j dƒd}n|gSt|t ƒrEt|j ƒƒ}|j ƒxU|D]J}t||gƒ}t|tƒr+t|ƒ}n|j||fƒqôWnt|ƒdkrwt|dtƒrw|d}nt|tƒr²tr¥|j dttƒƒq²|j ƒn|S(sÇ Takes a policy and returns a list, the contents of which are all hashable and sorted. Example input policy: {'Version': '2012-10-17', 'Statement': [{'Action': 's3:PutObjectAcl', 'Sid': 'AddCannedAcl2', 'Resource': 'arn:aws:s3:::test_policy/*', 'Effect': 'Allow', 'Principal': {'AWS': ['arn:aws:iam::XXXXXXXXXXXX:user/username1', 'arn:aws:iam::XXXXXXXXXXXX:user/username2']} }]} Returned value: [('Statement', ((('Action', (u's3:PutObjectAcl',)), ('Effect', (u'Allow',)), ('Principal', ('AWS', ((u'arn:aws:iam::XXXXXXXXXXXX:user/username1',), (u'arn:aws:iam::XXXXXXXXXXXX:user/username2',)))), ('Resource', (u'arn:aws:s3:::test_policy/*',)), ('Sid', (u'AddCannedAcl2',)))), ('Version', (u'2012-10-17',)))] s arn:aws:iam::s:roott:iiiR±(R’RËt_hashable_policyttupleRªRRRt startswithtendswithtsplitRjtkeystsortRÌtPY3_COMPARISONR tpy3cmp(tpolicyt policy_listteacht tupleifiedt sorted_keysR±((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyRÙs4    %  cCs¤y(||krdS||kr#dSdSWnutk rŸ}t|ƒjdƒ}t|ƒjdƒ}d||fkr™||kr†dS||kr™dSn‚nXdS(sh Python 2 can sort lists of mixed types. Strings < tuples. Without this function this fails on Python 3.iiÿÿÿÿiRURÚN(t TypeErrorRtfind(tatbR@tstr_indttup_ind((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyRáMs    cCs(tt|gƒƒtt|gƒƒkS(sy Compares the existing policy and the updated policy Returns True if there is a difference between policies. (RÉRÙ(tcurrent_policyt new_policy((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pytcompare_policiescscs„‡fd†‰i}xh|jƒD]Z\}}t|tƒrPt|ƒ||>> my_iam_policy = {'Principle': {'AWS':["31","7","14","101"]} >>> sort_json_policy_dict(my_iam_policy) Returns: Dict: Will return a copy of the policy as a Dict but any List will be sorted { 'Principle': { 'AWS': [ '7', '14', '31', '101' ] } } cs…g}xe|D]]}t|tƒr8|jt|ƒƒq t|tƒr]|jˆ|ƒƒq |j|ƒq W|jdd„ƒ|S(NR±cSs#t|tƒrt|jƒƒS|S(N(R’RjtsortedR‘(tx((s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyt‰s(R’RjRªtsort_json_policy_dictRËRß(tmy_listt checked_listtitem(t value_is_list(s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyR÷|s (R‘R’RjRóRË(t policy_dicttordered_policy_dictR±R•((R÷s</usr/lib/python2.7/site-packages/ansible/module_utils/ec2.pyRójscCs |dkrdSt|ƒƒ}t|tƒr¥xØ|D]i}||kršt||tƒr|t||||dƒ||sj   "                   u     $$@ 3   . *