File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 3131 cfg .StrOpt ('output_path' ,
3232 default = '/var/spool/apel/outgoing/openstack' ,
3333 help = "Directory to put the generated SSM records." ),
34+ cfg .IntOpt ('max_size' ,
35+ default = 100 ,
36+ help = "Maximum number of records to send per message" ),
3437]
3538
3639CONF = cfg .CONF
@@ -63,14 +66,18 @@ def push(self, records):
6366 aux += "%s: %s\n " % (k , v )
6467 entries .append (aux )
6568
66- message = "%s\n " % self .header
67-
68- sep = "%s\n " % self .separator
69- message += "%s" % sep .join (entries )
70-
7169 # FIXME(aloga): try except here
7270 queue = dirq .QueueSimple .QueueSimple (CONF .ssm .output_path )
73- queue .add (message )
71+
72+ # Divide message into smaller chunks as per GGUS #143436
73+ # https://ggus.eu/index.php?mode=ticket_info&ticket_id=143436
74+ for i in range (0 , len (entries ), CONF .ssm .max_size ):
75+ message = "%s\n " % self .header
76+
77+ sep = "%s\n " % self .separator
78+ message += "%s" % sep .join (entries [i :i + CONF .ssm .max_size ])
79+
80+ queue .add (message )
7481
7582
7683class SSMMessengerV02 (_SSMBaseMessenger ):
Original file line number Diff line number Diff line change 294294
295295# Directory to put the generated SSM records. (string value)
296296#output_path = /var/spool/apel/outgoing/openstack
297+
298+ # Maximum number of records to send per message (integer value)
299+ #max_size = 100
You can’t perform that action at this time.
0 commit comments