
?F[c        
   @   s  d  d l  Z d  d l m Z m Z d  d l m Z d  d l m Z d d d d d	 d
 d d d d g
 Z	 d e
 f d     YZ e d k re   Z i  Z e j e  e j j d e d d e d j  Z d GHx e D] Z e j   q We d d d d d e  Z e j e  Z d GHe j   e e j  Z e e d Z d e d e f GHe j j d  Z e j   j   d k re j  e d  qd  GHn  d S(!   iN(   t   StringPropertyt   IntegerProperty(   t   propget(   t   sixs   m1.smalls   m1.larges	   m1.xlarges	   c1.mediums	   c1.xlarges	   m2.xlarges
   m2.2xlarges
   m2.4xlarges   cc1.4xlarges   t1.microt   BuyReservationc           B   s5   e  Z d    Z d   Z d   Z d   Z d   Z RS(   c         C   sY   | j  d d   sU t d d d d d t j j  } t j  | d t j j | d <n  d  S(   Nt   regiont   namet   verbose_names
   EC2 Regiont   choices(   t   gett   NoneR    t   botot   ec2t   regionsR   (   t   selft   paramst   prop(    (    s6   lib/python2.7/site-packages/boto/ec2/buyreservation.pyt
   get_region"   s    c         C   sG   | j  d d   sC t d d d d d t  } t j  |  | d <n  d  S(   Nt   instance_typeR   R   s   Instance TypeR   (   R	   R
   R    t   InstanceTypesR   (   R   R   R   (    (    s6   lib/python2.7/site-packages/boto/ec2/buyreservation.pyt   get_instance_type(   s    	c         C   sA   | j  d d   s= t d d d d  } t j  |  | d <n  d  S(   Nt   quantityR   R   s   Number of Instances(   R	   R
   R   R   (   R   R   R   (    (    s6   lib/python2.7/site-packages/boto/ec2/buyreservation.pyt   get_quantity.   s    c         C   sM   | j  d d   sI t d d d d d |  j j  } t j  |  | d <n  d  S(   Nt   zoneR   R   s   EC2 Availability ZoneR   (   R	   R
   R    R   t   get_all_zonesR   (   R   R   R   (    (    s6   lib/python2.7/site-packages/boto/ec2/buyreservation.pyt   get_zone3   s    c         C   sK   |  j  |  | d j   |  _ |  j |  |  j |  |  j |  d  S(   NR   (   R   t   connectR   R   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/boto/ec2/buyreservation.pyR	   9   s
    (   t   __name__t
   __module__R   R   R   R   R	   (    (    (    s6   lib/python2.7/site-packages/boto/ec2/buyreservation.pyR       s
   				t   __main__R   t   availability_zoneR   s;   
The following Reserved Instances Offerings are available:
R   t   offeringR   t   OfferingR   s   
You have chosen this offering:R   sL   !!! You are about to purchase %d of these offerings for a total of $%.2f !!!s5   Are you sure you want to do this?  If so, enter YES: t   yess   Purchase cancelled(!   t   boto.ec2R   t   boto.sdb.db.propertyR    R   t   boto.manageR   t   boto.compatR   R   t   objectR   R   t   objR   R	   R   t$   get_all_reserved_instances_offeringsR   t	   offeringsR   t   describeR   t   floatt   fixed_pricet
   unit_pricet   total_pricet   movest   inputt   answert   stript   lowert   purchase(    (    (    s6   lib/python2.7/site-packages/boto/ec2/buyreservation.pyt   <module>   s:   				 		
