Esempio n. 1
0
def _configure(args):

    config_files = []
    virtual_path = os.getenv('VIRTUAL_ENV')
    cfg_file = '{0}.conf'.format(PROJECT)

    # if virtualenv is active; then leverage <virtualenv>/etc
    # and <virtualenv>/etc/<project>
    if virtual_path:
        config_files.append(os.path.join(virtual_path, 'etc', cfg_file))
        config_files.append(os.path.join(virtual_path, 'etc',
                                         PROJECT, cfg_file))

    config_files.extend(
        cfg.find_config_files(project=PROJECT))

    cfg.CONF(args,
             project=PROJECT,
             version=version.version_string(),
             default_config_files=list(moves.filter(os.path.isfile,
                                                    config_files)))

    # if no config_dir was provided then we will set it to the
    # path of the most specific config file found.
    if not cfg.CONF.config_dir:
        cfg.CONF.set_default('config_dir',
                             os.path.dirname(cfg.CONF.config_file[-1]))
Esempio n. 2
0
 def test_version_str(self):
     self.assertIsNotNone(version.version_string())