#2887 Read config options from main hub config and hub config dir
Merged a year ago by tkopecek. Opened a year ago by jcupova.
jcupova/koji issue-2839  into  master

file modified
+3 -3
@@ -2,7 +2,6 @@ 

  

  import os

  import xmlrpc.client

- from configparser import RawConfigParser

  from optparse import OptionParser

  

  import koji.db
@@ -131,6 +130,8 @@ 

                        help="Don't delete anything, print estimations (implies -v)")

      parser.add_option('-c', '--conf', default='/etc/koji-hub/hub.conf',

                        action='store', help="Path to koji's hub.conf")

+     parser.add_option('--config-dir', default='/etc/koji-hub/hub.conf.d',

+                       action='store', help="Path to koji's hub.conf directory")

      parser.add_option('--no-vacuum', action="store_false", dest="vacuum",

                        default=True,

                        help="Don't run vacuum on affected tables")
@@ -167,8 +168,7 @@ 

      if not os.path.exists(options.conf):

          parser.error("Config file doesn't exist")

  

-     config = RawConfigParser()

-     config.read(options.conf)

+     config = koji.read_config_files([options.config_dir, (options.conf, True)], raw=True)

  

      cfgmap = [

          # option, type, default

rebased onto b829e11d387c667c24d5d3d43d5fc1906d55bc59

a year ago

It is a copy from hub where these environment options are present. Here, you need to declare new cli option (--config-dir in addition to --config) and pass it here. Script doesn't read anything from environment.

rebased onto c35e1f9

a year ago

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

a year ago

Metadata Update from @jobrauer:
- Pull-request tagged with: testing-done

a year ago

Commit 976120a fixes this pull-request

Pull-Request has been merged by tkopecek

a year ago