Revision e2db4a57 ci/utils.py

b/ci/utils.py
16 16
from kamaki.clients.cyclades import CycladesClient
17 17
from kamaki.clients.image import ImageClient
18 18

  
19
DEFAULT_CONFIG_FILE = "new_config"
20

  
19 21

  
20 22
def _run(cmd, verbose):
21 23
    """Run fabric with verbose level"""
......
85 87
class SynnefoCI(object):
86 88
    """SynnefoCI python class"""
87 89

  
88
    def __init__(self, cleanup_config=False, cloud=None):
90
    def __init__(self, config_file=None, cleanup_config=False, cloud=None):
89 91
        """ Initialize SynnefoCI python class
90 92

  
91 93
        Setup logger, local_dir, config and kamaki
......
102 104
        self.repo_dir = os.path.dirname(self.ci_dir)
103 105

  
104 106
        # Read config file
105
        default_conffile = os.path.join(self.ci_dir, "new_config")
106
        self.conffile = os.environ.get("SYNNEFO_CI_CONFIG_FILE",
107
                                       default_conffile)
107
        if config_file is None:
108
            config_file = DEFAULT_CONFIG_FILE
109
        if not os.path.isabs(config_file):
110
            config_file = os.path.join(self.ci_dir, config_file)
108 111

  
109 112
        self.config = ConfigParser()
110 113
        self.config.optionxform = str
111
        self.config.read(self.conffile)
114
        self.config.read(config_file)
112 115
        temp_config = self.config.get('Global', 'temporary_config')
113 116
        if cleanup_config:
114 117
            try:

Also available in: Unified diff