CCI-MOC / flocx-market

2 stars 9 forks source link

Hooks for default config file and business logic objects #25

Closed ljmcgann closed 5 years ago

ljmcgann commented 5 years ago

Created service.py which hooks to oslo the configuration options from the config file located at /etc/flocx-market/flocx-market.conf to make them accessible by the CONF object. Additionally, added the version and objects hooks, so oslo cna be aware of the version through pbr and the business logic objects we will eventually create in the flocx_market/objects directory

tzumainn commented 5 years ago

I'm okay with this because I'm not sure there are useful unit tests for this code, but I'll defer to @larsks 's opinion on that!

larsks commented 5 years ago

I think we do need unit tests there, because in addition to verifying that things work as intended that helps protect against things like someone accidentally introducing a typo in the future, etc. I figure a test for prepare_service() called with default parameters, a test for prepare_service() called with a valid command line option (verifying that it sets the value in CONF as expected), and a test for calling prepare_service() with an invalid command line option (verifying that it fails as expected).

tzumainn commented 5 years ago

Thinking about it, I also don't think there's a reason to expose every option to the CLI. Maybe just the API ones?

tzumainn commented 5 years ago

I'm good with this now - thanks for the changes, @ljmcgann!

@larsks, any reservations?

larsks commented 5 years ago

Looks good to me!