Skip to content

Commit

Permalink
Merge pull request #53 from teddyrendahl/qs_err
Browse files Browse the repository at this point in the history
FIX: Non-sensical error message
  • Loading branch information
ZLLentz authored Mar 8, 2018
2 parents 443ff9b + 5bcc266 commit a1443cd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions happi/backends/qs_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ def __init__(self, run_no, proposal, **kwargs):
self.db = dict()
logger.debug("Requesting proposal information for %s", proposal)
raw = self.qs.getProposalDetailsForRun(run_no, proposal)
for field, _class in self.device_translations.items():
for table, _class in self.device_translations.items():
# Create a regex pattern to find all the appropriate pattern match
pattern = re.compile('pcdssetup-{}-'
'setup-(\d+)-(\w+)'.format(field))
'setup-(\d+)-(\w+)'.format(table))
# Search for all keys that match the device and store in a
# temporary dictionary
devices = dict()
Expand All @@ -121,10 +121,10 @@ def __init__(self, run_no, proposal, **kwargs):
devices[dev_no][match.group(2)] = raw[field]
# Store the devices as happi items
if not devices:
logger.info("No device information found under '%s'", field)
logger.info("No device information found under '%s'", table)
else:
logger.debug("Found %s devices under %s table",
len(devices), field)
len(devices), table)
for num, dev_info in devices.items():
try:
post = {'name': dev_info.pop('name'),
Expand All @@ -148,7 +148,7 @@ def __init__(self, run_no, proposal, **kwargs):
except Exception as exc:
logger.warning("Unable to create an object from "
"Questionnaire table %s row %s",
field, num)
table, num)
else:
self.db[post['_id']] = post

Expand Down

0 comments on commit a1443cd

Please sign in to comment.