{"project": "%s" %src})
xml_root.append(link_element)
- # Modify repo attribute
- repo_element = xml_root.find('repository')
-
- if repo_element is not None:
+ # Set linkedbuild attribute for all repositories
+ for repo_element in xml_root.findall('repository'):
repo_element.set('linkedbuild', linktype)
self.set_meta(ElementTree.tostring(xml_root), project)
# remov linked project
xml_root.remove(xml_root.find('link'))
- # Modify repo attribute
- repo_element = xml_root.find('repository')
- repo_element.attrib.pop('linkedbuild')
+ # Remove linkedbuild attribute from all repositories
+ for repo_element in xml_root.findall('repository'):
+ repo_element.attrib.pop('linkedbuild')
self.set_meta(ElementTree.tostring(xml_root), project)