Skip to content

Commit 1037dbe

Browse files
committed
Make portal_runid more unique and fix HOST
1 parent 6231d33 commit 1037dbe

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

ipsframework/configurationManager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ def _initialize_fwk_components(self):
382382
portal_conf['USER'] = self.sim_map[self.fwk_sim_name].sim_conf['USER']
383383
except KeyError:
384384
portal_conf['USER'] = self.platform_conf['USER']
385+
portal_conf['HOST'] = self.platform_conf['HOST']
385386
if self.fwk.log_level == logging.DEBUG:
386387
portal_conf['LOG_LEVEL'] = 'DEBUG'
387388

ipsframework/ips.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ def _send_monitor_event(self, sim_name='', eventType='', comment='', ok=True, ta
611611
get_config = self.config_manager.get_config_parameter
612612
if eventType == 'IPS_START':
613613
portal_data['state'] = 'Running'
614-
portal_data['host'] = get_config(sim_name, 'HOST')
614+
portal_data['host'] = self.config_manager.get_platform_parameter('HOST')
615615
try:
616616
portal_data['outputprefix'] = get_config(sim_name, 'OUTPUT_PREFIX')
617617
except KeyError:

ipsframework/portalBridge.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ def __init__(self, services, config):
8181
:py:class:`component.Component` object.
8282
"""
8383
super().__init__(services, config)
84-
self.host = ''
8584
self.curTime = time.localtime()
8685
self.startTime = self.curTime
8786
self.sim_map = {}
@@ -109,7 +108,6 @@ def init(self, timestamp=0.0, **keywords):
109108
self.portal_url = self.PORTAL_URL
110109
except AttributeError:
111110
pass
112-
self.host = self.services.get_config_param('HOST')
113111
self.services.subscribe('_IPS_MONITOR', "process_event")
114112
try:
115113
freq = int(self.services.get_config_param("HTML_DUMP_FREQ", silent=True))
@@ -427,7 +425,7 @@ def init_simulation(self, sim_name, sim_root):
427425

428426
d = datetime.datetime.now()
429427
date_str = "%s.%03d" % (d.strftime("%Y-%m-%dT%H:%M:%S"), int(d.microsecond / 1000))
430-
sim_data.portal_runid = "_".join([self.host, "USER", date_str])
428+
sim_data.portal_runid = "_".join([sim_name, getattr(self, "HOST"), getattr(self, "USER"), date_str])
431429
try:
432430
self.services.set_config_param('PORTAL_RUNID', sim_data.portal_runid,
433431
target_sim_name=sim_name)
@@ -445,8 +443,7 @@ def init_simulation(self, sim_name, sim_root):
445443
(sim_log_dir, oserr.errno, oserr.strerror))
446444
raise
447445

448-
sim_data.monitor_file_name = os.path.join(sim_log_dir,
449-
sim_data.sim_name + '_' + sim_data.portal_runid + '.eventlog')
446+
sim_data.monitor_file_name = os.path.join(sim_log_dir, sim_data.portal_runid + '.eventlog')
450447
try:
451448
sim_data.monitor_file = open(sim_data.monitor_file_name, 'wb', 0)
452449
except IOError as oserr:

0 commit comments

Comments
 (0)