#3019 [protonmsg] convert btypes to json string
Closed 3 years ago by julian8628. Opened 3 years ago by julian8628.
julian8628/koji issue/3017  into  master

file modified
+1 -1
@@ -216,7 +216,7 @@ 

               'name': kws['info']['name'],

               'version': kws['info']['version'],

               'release': kws['info']['release'],

-              'btypes': btypeinfo,

+              'btypes': json.dumps(btypeinfo, default=json_serialize),

               'attribute': kws['attribute'],

               'old': old,

               'new': new}

@@ -1,5 +1,6 @@ 

  from __future__ import absolute_import

  

+ import json

  import tempfile

  import unittest

  
@@ -132,7 +133,7 @@ 

          assert_info = {'name': 'test-pkg',

                         'version': '1.0',

                         'release': '1',

-                        'btypes': {'image': {'build_id': 1}}}

+                        'btypes': json.dumps({'image': {'build_id': 1}})}

          self.get_build_type.return_value = {'image': {'build_id': 1}}

          protonmsg.prep_build_state_change('postBuildStateChange',

                                            info=info, attribute='volume_id',
@@ -155,7 +156,7 @@ 

          assert_info = {'name': 'test-pkg',

                         'version': '1.0',

                         'release': '1',

-                        'btypes': {}}

+                        'btypes': '{}'}

          self.get_build_type.return_value = {}

          protonmsg.prep_build_state_change('postBuildStateChange',

                                            info=info, attribute='volume_id',

Moving it from headers to body (and leave as a dict) makes more sense here.

@julian8628 I've created #3022 for moving it to body.

Pull-Request has been closed by julian8628

3 years ago