~cbehrens/nova/lp844160-build-works-with-zones

« back to all changes in this revision

Viewing changes to contrib/boto_v6/ec2/instance.py

  • Committer: NTT PF Lab.
  • Date: 2010-12-24 11:38:49 UTC
  • mto: This revision was merged to the branch mainline in revision 564.
  • Revision ID: openstack@lab.ntt.co.jp-20101224113849-z9nemzmki17bxnvw
SupportĀ IPv6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'''
 
2
Created on 2010/12/20
 
3
 
 
4
@author: Nachi Ueno <ueno.nachi@lab.ntt.co.jp>
 
5
'''
 
6
import boto
 
7
from boto.resultset import ResultSet
 
8
from boto.ec2.instance import Reservation
 
9
from boto.ec2.instance import Group
 
10
from boto.ec2.instance import Instance
 
11
 
 
12
 
 
13
class ReservationV6(Reservation):
 
14
    def startElement(self, name, attrs, connection):
 
15
        if name == 'instancesSet':
 
16
            self.instances = ResultSet([('item', InstanceV6)])
 
17
            return self.instances
 
18
        elif name == 'groupSet':
 
19
            self.groups = ResultSet([('item', Group)])
 
20
            return self.groups
 
21
        else:
 
22
            return None
 
23
 
 
24
 
 
25
class InstanceV6(Instance):
 
26
    def __init__(self, connection=None):
 
27
        Instance.__init__(self, connection)
 
28
        self.public_dns_name_v6 = None
 
29
 
 
30
    def endElement(self, name, value, connection):
 
31
        Instance.endElement(self, name, value, connection)
 
32
        if name == 'dnsNameV6':
 
33
            self.dns_name_v6 = value