usnistgov / SpectrumBrowser

ITL
12 stars 11 forks source link

I would like setup-test-sensors.py to use MSODConfig.json instead of os.environ #205

Closed jkubNTIA closed 9 years ago

jkubNTIA commented 9 years ago

I would like setup-test-sensors.py to use the values in MSODConfig.json for "SPECTRUM_BROWSER_HOME" and "TEST_DATA_LOCATION" instead of using os.environ.get() since no longer use environment variables. Also, could we add "TEST_DATA_LOCATION" to MSODConfig.json

jkubNTIA commented 9 years ago

To be more clear, I would like to use Bootstrap.py in setup-test-sensors.py to load MSODconfig.json, instead of the parse_msod_config() function calling configFile = open(os.environ.get("HOME") + "/.msod/MSODConfig.json"), since we store our MSODconfig.json file in "/etc/msod/MSODConfig.json" which is part of the path that Bootstrap.py checks if MSODconfig.json does not exist in os.environ.get("HOME") + "/.msod/MSODConfig.json".

Also, if we do not want to add "TEST_DATA_LOCATION" to MSODConfig.json (since only for testing, not for the production build), perhaps we could pass in the file path to the test data location instead of using the os.environ.get("TEST_DATA_LOCATION") code?

We are really trying to get away from using environment variables on our production machine.

ranganathanm commented 9 years ago

We can make these changes but please note that these are unit tests. We don't want to run these unit tests on a production system.

These tests are not included on a deployed system - you should not be copying them over to your production machine. Instead, please test out on your build machine and deploy to the production machine (without these tests included).


From: jkub01 notifications@github.com Sent: Monday, July 27, 2015 9:40 AM To: usnistgov/SpectrumBrowser Cc: Ranganathan, Mudumbai Subject: Re: [SpectrumBrowser] I would like setup-test-sensors.py to use MSODConfig.json instead of os.environ (#205)

To be more clear, I would like to use Bootstrap.py in setup-test-sensors.py to load MSODconfig.json, instead of the parse_msod_config() function calling configFile = open(os.environ.get("HOME") + "/.msod/MSODConfig.json"), since we store our MSODconfig.json file in "/etc/msod/MSODConfig.json" which is part of the path that Bootstrap.py checks if MSODconfig.json does not exist in os.environ.get("HOME") + "/.msod/MSODConfig.json".

Also, if we do not want to add "TEST_DATA_LOCATION" to MSODConfig.json (since only for testing, not for the production build), perhaps we could pass in the file path to the test data location instead of using the os.environ.get("TEST_DATA_LOCATION") code?

We are really trying to get away from using environment variables on our production machine.

Reply to this email directly or view it on GitHubhttps://github.com/usnistgov/SpectrumBrowser/issues/205#issuecomment-125207281.

ranganathanm commented 9 years ago

Fixed in cc166bdaed8a8eea26fe27489b3144b87f6a2f11

fab deployTests:/path/to/test/data

ranganathanm commented 9 years ago

Kheri, please test and close.

klhicks commented 9 years ago

This was updated and tested in my dev environment. It works.