Changeset 965 for trunk/Monitoring
- Timestamp:
- 11/07/13 14:49:45 (10 years ago)
- Location:
- trunk/Monitoring/smon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Monitoring/smon/repo_io.py
r937 r965 19 19 import datetime 20 20 21 # line below is to include Prodiguer database I/O library in the search path 22 sys.path.append("/opt/supervisor/prodiguer_lib/src") 23 24 25 import types 21 22 26 23 27 24 … … 33 30 34 31 35 36 37 32 g__remote_database_host="ib-pp-db-dev.ipslnet" 33 g__remote_database_port="5432" 34 g__remote_database_name="pdgr_1_0b5" 38 35 39 36 … … 41 38 42 39 # set mode 43 #mode=CSTE_MODE_REMOTE_REPO44 mode=CSTE_MODE_LOCAL_REPO40 mode=CSTE_MODE_REMOTE_REPO 41 #mode=CSTE_MODE_LOCAL_REPO 45 42 46 43 # mode specific init. (e.g. repository driver) … … 50 47 elif mode==CSTE_MODE_REMOTE_REPO: 51 48 49 # line below is to include Prodiguer database I/O library in the search path 50 sys.path.append("/opt/supervisor/prodiguer_lib/src") 51 52 import types 53 52 54 # import Prodiguer database I/O library 53 55 import prodiguer_shared.mq.hooks as repo 54 55 56 # HACK57 # (uncomment those two lines if use prodiguer repo)58 56 import prodiguer_shared.repo.session as repo_session 59 57 import prodiguer_shared.models as models … … 94 92 repo.connect() 95 93 elif mode==CSTE_MODE_REMOTE_REPO: 96 _CONNECTION = "postgresql://postgres:Silence107!@ ib-pp-db-dev.ipslnet:5432/pdgr_1_0b5"94 _CONNECTION = "postgresql://postgres:Silence107!@%s:%s/%s"%(g__remote_database_host,g__remote_database_port,g__remote_database_name) 97 95 repo_session.start(_CONNECTION) 98 96 … … 245 243 simulation=repo.retrieve_simulation(name) 246 244 except: 247 traceback.print_exc()245 raise 248 246 249 247 elif mode==CSTE_MODE_REMOTE_REPO: … … 356 354 repo.update_simulation_status(simulation) 357 355 except: 358 traceback.print_exc()356 raise 359 357 360 358 elif mode==CSTE_MODE_REMOTE_REPO: -
trunk/Monitoring/smon/test_remote_repo.py
r859 r965 1 2 3 1 4 import sys 2 sys.path.append("/home/jripsl/snapshot/src")3 4 5 import elixir 5 6 6 # Module imports. 7 import prodiguer_shared.repo as repo 8 import prodiguer_shared.repo.mq.hooks as mq_hooks 7 8 # import Prodiguer database I/O library 9 sys.path.append("/opt/supervisor/prodiguer_lib/src") 10 import prodiguer_shared.mq.hooks as repo 11 import prodiguer_shared.repo.session as repo_session 9 12 10 13 11 # Repo connection string. 12 _CONNECTION = "postgresql://postgres:Silence107!@localhost:5432/prodiguer" 14 # dbname 15 # pdgr_1_0b5 16 # prodiguer 17 18 # connection string. 19 #_CONNECTION = "postgresql://postgres:Silence107!@localhost:5432/prodiguer" 20 _CONNECTION = "postgresql://postgres:Silence107!@ib-pp-db-dev.ipslnet:5432/pdgr_1_0b5" 21 22 23 13 24 14 25 # Get prodiguer session handler. 15 repo .connect(_CONNECTION)26 repo_session.start(_CONNECTION) 16 27 17 28 # Invoke hooks. 18 mq_hooks.update_simulation_status('1pctCO22', 'ERROR')29 repo.update_simulation_status('1pctCO22', 'ERROR') 19 30 20 31 # Commit. 21 repo .commit()32 repo_session.commit() 22 33 23 34
Note: See TracChangeset
for help on using the changeset viewer.