Skip to content

Commit

Permalink
Merge pull request #1077 from lnls-sirius/improve-comp-configs
Browse files Browse the repository at this point in the history
Improve comp configs
  • Loading branch information
xresende authored Mar 11, 2024
2 parents a223e18 + acb5ab8 commit 6d018d6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion siriuspy/siriuspy/clientconfigdb/configdb_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,19 @@ def compare_configs(config1, config2, pos_pattern=None, neg_pattern=None):
cf1pvs = {n: v for n, v, _ in config1['pvs']}
cf2pvs = {n: v for n, v, _ in config2['pvs']}

lines = []
for pv in cf1pvs.keys() | cf2pvs.keys():
if not pos_re.match(pv) or neg_re.match(pv):
continue
val1 = str(cf1pvs.get(pv, 'Not present'))
val2 = str(cf2pvs.get(pv, 'Not present'))
if val1 != val2:
print(f'{pv:50s} {val1[:30]:30s} {val2[:30]:30s}')
lines.append(f'{pv:50s} {val1[:30]:30s} {val2[:30]:30s}')

# sort and print lines
lines = sorted(lines)
for line in lines:
print(line)

@classmethod
def check_valid_configname(cls, name):
Expand Down

0 comments on commit 6d018d6

Please sign in to comment.