#419 Move GREENWAVE_API_URL to the config.py.
Merged 5 years ago by gnaponie. Opened 5 years ago by cverna.
cverna/greenwave _greenwave_config  into  master

file modified
-3
@@ -126,7 +126,4 @@ 

      # but whose cert names aren't in the associated list are dropped; messages

      # whose topics do not appear in the routing_policy are not dropped.

      routing_nitpicky=False,

- 

-     # Greenwave API url

-     greenwave_api_url='https://greenwave.domain.local/api/v1.0',

  )

file modified
+2
@@ -35,6 +35,8 @@ 

  

      # By default, don't cache anything.

      CACHE = {'backend': 'dogpile.cache.null'}

+     # Greenwave API url

+     GREENWAVE_API_URL = 'https://greenwave.domain.local/api/v1.0'

  

  

  class ProductionConfig(Config):

@@ -274,7 +274,7 @@ 

          log.info('Getting greenwave info')

  

          for decision_context, product_version in sorted(contexts_product_versions):

-             greenwave_url = self.fedmsg_config['greenwave_api_url'] + '/decision'

+             greenwave_url = current_app.config['GREENWAVE_API_URL'] + '/decision'

  

              data = {

                  'decision_context': decision_context,

@@ -12,6 +12,7 @@ 

  import logging

  import json

  

+ from flask import current_app

  import fedmsg.consumers

  import requests

  
@@ -102,7 +103,7 @@ 

                  'subject_identifier': subject_identifier,

              }

              response = requests_session.post(

-                 self.fedmsg_config['greenwave_api_url'] + '/decision',

+                 current_app.config['GREENWAVE_API_URL'] + '/decision',

                  headers={'Content-Type': 'application/json'},

                  data=json.dumps(data))

  
@@ -117,7 +118,7 @@ 

                  'ignore_waiver': [waiver_id],

              })

              response = requests_session.post(

-                 self.fedmsg_config['greenwave_api_url'] + '/decision',

+                 current_app.config['GREENWAVE_API_URL'] + '/decision',

                  headers={'Content-Type': 'application/json'},

                  data=json.dumps(data))

  

This commit move the GREENWAVE_API_URL to config.py instead
of being in the fedmsg config. This is needed for the consumers
to work when using fedora-messaging.

Signed-off-by: Clement Verna cverna@tutanota.com

Commit b33f63a fixes this pull-request

Pull-Request has been merged by gnaponie

5 years ago

Pull-Request has been merged by gnaponie

5 years ago