Skip to content

Commit

Permalink
Fix participant profile ame replacement
Browse files Browse the repository at this point in the history
Allow profile_name be in any position in participant tag definition
instead of assuming it is the first argument

Cleanup one unnecessary list generation in line iteration
  • Loading branch information
jnippula committed Sep 23, 2024
1 parent 82bd45e commit 4cce520
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions combine_default_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ def cleanup_temporary_files():
keep_config = True
with open(default_profiles_file, "r") as in_f:
with open(agent_refs_tmp_file, "w") as out_f:
for line in in_f.readlines():
for line in in_f:
line_str = line.strip()

# Replace participant profile name
if line_str.startswith("<participant profile_name="):
if line_str.startswith("<participant") and "profile_name=" in line_str:
line = re.sub(
'<participant profile_name="\S+"',
'<participant profile_name="default_xrce_participant"',
'profile_name="\S+"',
'profile_name="default_xrce_participant"',
line)

# Remove data_reader and data_writer configs
Expand Down

0 comments on commit 4cce520

Please sign in to comment.