Always return dictionary for _localectl_status

If no locale information is set, then this could be returning a string (which
we don't use anyway) and will cause an error when trying to run a .get()
against it.

Fixes #46862
This commit is contained in:
Daniel Wallace 2018-04-04 09:35:18 -05:00
parent a0e168ccee
commit 2d7c7b5e33
No known key found for this signature in database
GPG key ID: 5FA5E5544F010D48

View file

@ -87,7 +87,7 @@ def _localectl_status():
ret[ctl_key] = {}
ret[ctl_key][loc_set[0]] = loc_set[1]
else:
ret[ctl_key] = ctl_data
ret[ctl_key] = {'data': ctl_data}
if not ret:
log.debug("Unable to find any locale information inside the following data:\n%s", locale_ctl_out)
raise CommandExecutionError('Unable to parse result of "localectl"')