Skip to content

Instantly share code, notes, and snippets.

@dims
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save dims/4a25c81212c1e47ebb62 to your computer and use it in GitHub Desktop.

Select an option

Save dims/4a25c81212c1e47ebb62 to your computer and use it in GitHub Desktop.
Quick oslo.config example for testing
#/etc/my.conf
[DEFAULT]
###########
# Logging #
###########
# syslog server configuration (default port(UDP): 514)
# NOTE: Following logging configuration can be left as is for logs to come on UI
syslog_host=127.0.0.1
syslog_port=514
# log facility
log_facility=LOG_LOCAL3
[HA]
NODE_NAME=NODE1
DIR_STR=/opt
[OPENSTACK]
HA_VIRTUAL_IP=192.168.0.26
import sys
from oslo.config import cfg
CONF = cfg.CONF
CONF.register_opt(cfg.StrOpt('NODE_NAME'), cfg.OptGroup('HA'))
def main():
CONF(sys.argv[1:], default_config_files=['app.conf'])
print cfg.CONF.HA.NODE_NAME
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment