diff --git a/pillar/cli/maintenance.py b/pillar/cli/maintenance.py index 0d9efb34..22a56953 100644 --- a/pillar/cli/maintenance.py +++ b/pillar/cli/maintenance.py @@ -1064,6 +1064,7 @@ def find_video_files_without_duration(): with output_fpath.open('w', encoding='ascii') as outfile: outfile.write('\n'.join(sorted(file_ids))) + @manager_maintenance.command def find_video_nodes_without_duration(): """Finds video nodes without any duration @@ -1142,7 +1143,8 @@ def reconcile_node_video_duration(nodes_to_update=None, all_nodes=False, go=Fals {'$unwind': '$_files.variations'}, {'$match': {'_files.variations.duration': {'$gt': 0}}}, {'$addFields': { - 'need_update': {'$ne': ['$_files.variations.duration', '$properties.duration_seconds']} + 'need_update': { + '$ne': ['$_files.variations.duration', '$properties.duration_seconds']} }}, {'$match': {'need_update': True}}, {'$project': { diff --git a/tests/test_cli/test_maintenance.py b/tests/test_cli/test_maintenance.py index 5761e944..43915324 100644 --- a/tests/test_cli/test_maintenance.py +++ b/tests/test_cli/test_maintenance.py @@ -316,7 +316,8 @@ class ReconcileNodeDurationTest(AbstractPillarTest): with mock.patch('pillar.api.utils.utcnow') as mock_utcnow: mock_utcnow.return_value = self.fake_now - to_reconcile = [str(self.node_id0), str(self.node_id1), str(self.node_id2), str(self.node_id5)] + to_reconcile = [str(self.node_id0), str(self.node_id1), str(self.node_id2), + str(self.node_id5)] reconcile_node_video_duration(nodes_to_update=to_reconcile, go=False) # Dry run self.assertAllUnchanged()