#21: Improve package parameter merging command
This commit is contained in:
parent
15b4257c73
commit
f2a8166874
@ -19,6 +19,10 @@ class Command(BaseCommand):
|
|||||||
component_parameters = ComponentParameter.objects.filter(component=component)
|
component_parameters = ComponentParameter.objects.filter(component=component)
|
||||||
package_param_ids = package_parameters.values_list('parameter_type_id', flat=True)
|
package_param_ids = package_parameters.values_list('parameter_type_id', flat=True)
|
||||||
component_param_ids = component_parameters.values_list('parameter_type_id', flat=True)
|
component_param_ids = component_parameters.values_list('parameter_type_id', flat=True)
|
||||||
|
|
||||||
|
# Skip trivial cases
|
||||||
|
if len(package_param_ids) == 0 or len(component_param_ids) == 0:
|
||||||
|
continue
|
||||||
|
|
||||||
self.stdout.write(f'Comp: {str(component)} Found {len(component_param_ids)} different parameters')
|
self.stdout.write(f'Comp: {str(component)} Found {len(component_param_ids)} different parameters')
|
||||||
self.stdout.write(f'\tPackage: {str(component.package)} Found {len(package_param_ids)} different parameters')
|
self.stdout.write(f'\tPackage: {str(component.package)} Found {len(package_param_ids)} different parameters')
|
||||||
@ -36,4 +40,4 @@ class Command(BaseCommand):
|
|||||||
if not options['dry_run']:
|
if not options['dry_run']:
|
||||||
comp_param.delete()
|
comp_param.delete()
|
||||||
else:
|
else:
|
||||||
self.stderr.write(f'\tParameter {common_type.parameter_name} is set on component {str(component)} and its package with different values: "{s1}" vs "{s2}"')
|
self.stderr.write(f'\tParameter {common_type.parameter_name} is set on component {str(component)} and its package with different values: "{s1}" vs "{s2}"')
|
||||||
|
Loading…
Reference in New Issue
Block a user