diff --git a/redis/_parsers/base.py b/redis/_parsers/base.py index 63bf5d7795..2da7a94b3d 100644 --- a/redis/_parsers/base.py +++ b/redis/_parsers/base.py @@ -11,6 +11,8 @@ NodeMigratedNotification, NodeMigratingNotification, NodeMovingNotification, + OSSNodeMigratedNotification, + OSSNodeMigratingNotification, ) if sys.version_info.major >= 3 and sys.version_info.minor >= 11: @@ -179,9 +181,29 @@ async def read_response( class MaintenanceNotificationsParser: """Protocol defining maintenance push notification parsing functionality""" + @staticmethod + def parse_oss_maintenance_start_msg(response): + # Expected message format is: + # SMIGRATING + id = response[1] + slots = response[2] + return OSSNodeMigratingNotification(id, slots) + + @staticmethod + def parse_oss_maintenance_completed_msg(response): + # Expected message format is: + # SMIGRATED + id = response[1] + node_address = response[2] + slots = response[3] + return OSSNodeMigratedNotification(id, node_address, slots) + @staticmethod def parse_maintenance_start_msg(response, notification_type): # Expected message format is: