Skip to content

Commit 0b62b4d

Browse files
committed
Iterate over pool elements with correct tag type only
1 parent a0cb6e8 commit 0b62b4d

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

oca/group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class GroupPool(Pool):
5454
}
5555

5656
def __init__(self, client):
57-
super(GroupPool, self).__init__('GROUP_POOL', 'POOL', client)
57+
super(GroupPool, self).__init__('GROUP_POOL', 'GROUP', client)
5858

5959
def _factory(self, xml):
6060
i = Group(xml, self.client)

oca/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class ImagePool(Pool):
186186
}
187187

188188
def __init__(self, client):
189-
super(ImagePool, self).__init__('IMAGE_POOL', 'POOL', client)
189+
super(ImagePool, self).__init__('IMAGE_POOL', 'IMAGE', client)
190190

191191
def _factory(self, xml):
192192
i = Image(xml, self.client)

oca/pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def info(self, filter=-3, range_start=-1, range_end=-1, *args):
108108
data = self.client.call(self.METHODS['info'], filter,
109109
range_start, range_end, *args)
110110
self._initialize_xml(data, self.pool_name)
111-
for element in self.xml:
111+
for element in self.xml.findall(self.element_name):
112112
self.append(self._factory(element))
113113

114114
def _factory(self):

oca/template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class VmTemplatePool(Pool):
9595
}
9696

9797
def __init__(self, client):
98-
super(VmTemplatePool, self).__init__('VMTEMPLATE_POOL', 'POOL', client)
98+
super(VmTemplatePool, self).__init__('VMTEMPLATE_POOL', 'VMTEMPLATE', client)
9999

100100
#def info(self,
101101

0 commit comments

Comments
 (0)