source_component_name = guess
break
if source_component_name is None:
- source_component = self.session.query(Component).order_by(Component.component_id).first()
- else:
- source_component = self.session.query(Component).filter_by(component_name=source_component_name).one()
+ # Source-only upload, use Package-List:
+ source_component_name = source.package_list.values()[0]['component']
+ if source_component_name not in suite.components:
+ raise ArchiveException('Component {0} does not exist in suite {1}.'.format(source_component_name, suite.suite_name))
+ source_component = self.session.query(Component).filter_by(component_name=source_component_name).one()
source_component_func = lambda source: source_component
db_changes = self._install_changes()