diff --git a/ros2bag/ros2bag/verb/record.py b/ros2bag/ros2bag/verb/record.py index 021cd5ab9a..26bf94f1a6 100644 --- a/ros2bag/ros2bag/verb/record.py +++ b/ros2bag/ros2bag/verb/record.py @@ -35,7 +35,8 @@ class RecordVerb(VerbExtension): def add_arguments(self, parser, cli_name): # noqa: D102 writer_choices = get_registered_writers() - default_writer = 'sqlite3' if 'sqlite3' in writer_choices else writer_choices[0] + default_writer = 'sqlite3' if 'sqlite3' in writer_choices else \ + next(iter(writer_choices)) compression_format_choices = get_registered_compressors() serialization_choices = get_registered_serializers() diff --git a/ros2bag/ros2bag/verb/reindex.py b/ros2bag/ros2bag/verb/reindex.py index 83ccca4c59..7a1ca6fc72 100644 --- a/ros2bag/ros2bag/verb/reindex.py +++ b/ros2bag/ros2bag/verb/reindex.py @@ -33,7 +33,9 @@ class ReindexVerb(VerbExtension): def add_arguments(self, parser, cli_name): storage_choices = get_registered_readers() - default_storage = 'sqlite3' if 'sqlite3' in storage_choices else storage_choices[0] + default_storage = 'sqlite3' if 'sqlite3' in storage_choices else \ + next(iter(storage_choices)) + parser.add_argument( 'bag_directory', type=check_path_exists, help='bag to reindex') parser.add_argument(