Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Move bmi_infra hard-coded project into config file #136

Open
pgrosu opened this issue Jul 20, 2017 · 5 comments
Open

Move bmi_infra hard-coded project into config file #136

pgrosu opened this issue Jul 20, 2017 · 5 comments

Comments

@pgrosu
Copy link

pgrosu commented Jul 20, 2017

Hi Guys,

I propose we move the following, from being hard-coded in ims/common/constants.py to the config file that usually resides in /etc/bmi/:

BMI_ADMIN_PROJECT = "bmi_infra"

This causes issues with deployment to new environments.

To fix this, it requires changes to the following five files:

  1. In /etc/bmi/bmiconfig*.cfg with something like this:
[bmi]
uid = 5
service = False
BMI_ADMIN_PROJECT = bmi_infra
  1. In ims/common/constants.py with something like this:
# BMI
UID_OPT = 'uid'
SERVICE_OPT = 'service'
BMI_ADMIN_PROJECT_OPT = 'BMI_ADMIN_PROJECT'
  1. In ims/common/bmi_config.py with something like this:

cfg.option(constants.BMI_SECTION, constants.BMI_ADMIN_PROJECT_OPT)

  1. In ims/cli/cli.py change all constants.BMI_ADMIN_PROJECT to _cfg.bmi.BMI_ADMIN_PROJECT.

  2. In ims/rpc/server/rpc_server.py change the following two lines:

    server.remake_mappings() -> server.remake_mappings( server.remake_mappings( cfg.bmi.BMI_ADMIN_PROJECT )

    with BMI("", "", constants.BMI_ADMIN_PROJECT) as bmi: -> with BMI("", "", BMI_ADMIN_PROJECT) as bmi:

Let me know, as I would like to have done fairly quickly for the 0.5 release.

Thanks,
Paul

@chemistry-sourabh
Copy link
Contributor

@pgrosu what issues in new environments ? Something like 2 BMIs using same HIL ?

@naved001
Copy link
Contributor

@chemistry-sourabh exactly. Do you know of a better way of handling this issue?

@chemistry-sourabh
Copy link
Contributor

Suffix the uid ?

@pgrosu
Copy link
Author

pgrosu commented Jul 20, 2017

Let's define as a group issue #138 first, and then we can properly fix this. In any case, we will still have to move these hard-coded instantiations outside of the code-base.

@apoorvemohan
Copy link
Collaborator

@chemistry-sourabh @naved001 can we close this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants