mirror of https://github.com/MISP/PyMISP
				
				
				
			
							parent
							
								
									ea327ceffb
								
							
						
					
					
						commit
						7ece6b7fbc
					
				|  | @ -265,7 +265,7 @@ class PyMISP(object): | |||
|             misp_event.publish() | ||||
|         return misp_event | ||||
| 
 | ||||
|     def _prepare_full_attribute(self, category, type_value, value, to_ids, comment=None, distribution=5, **kwargs): | ||||
|     def _prepare_full_attribute(self, category, type_value, value, to_ids, comment=None, distribution=None, **kwargs): | ||||
|         """Initialize a new MISPAttribute from scratch""" | ||||
|         misp_attribute = MISPAttribute(self.describe_types) | ||||
|         misp_attribute.set_all_values(type=type_value, value=value, category=category, | ||||
|  |  | |||
|  | @ -428,8 +428,9 @@ class MISPEvent(AbstractMISP): | |||
|             raise NewAttributeError('The info field of the new event is required.') | ||||
| 
 | ||||
|         # Default values for a valid event to send to a MISP instance | ||||
|         if kwargs.get('distribution') is not None: | ||||
|             self.distribution = int(kwargs.pop('distribution')) | ||||
|         self.distribution = kwargs.pop('distribution', None) | ||||
|         if self.distribution is not None: | ||||
|             self.distribution = int(self.distribution) | ||||
|             if self.distribution not in [0, 1, 2, 3, 4]: | ||||
|                 raise NewAttributeError('{} is invalid, the distribution has to be in 0, 1, 2, 3, 4'.format(self.distribution)) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Raphaël Vinot
						Raphaël Vinot