Last active
August 29, 2015 14:17
-
-
Save dims/4a25c81212c1e47ebb62 to your computer and use it in GitHub Desktop.
Quick oslo.config example for testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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