diff options
author | Michal Minar <miminar@redhat.com> | 2013-08-08 10:15:24 +0200 |
---|---|---|
committer | Michal Minar <miminar@redhat.com> | 2013-08-08 12:53:21 +0200 |
commit | 86d26bd8769c19128636f65ff1dcfe0eb5c5178e (patch) | |
tree | 0bc6701b06204f3bab932359917519887c7aff03 /src/software | |
parent | 4a1bf894fe2ea75272df5d7c158e0aa8489e5d1f (diff) | |
download | openlmi-providers-86d26bd8769c19128636f65ff1dcfe0eb5c5178e.tar.gz openlmi-providers-86d26bd8769c19128636f65ff1dcfe0eb5c5178e.tar.xz openlmi-providers-86d26bd8769c19128636f65ff1dcfe0eb5c5178e.zip |
software: let's not presume, that any url is associated with repo
Fixed UnboundLocalError, when expecting, that at least mirror_list
or some base_url of repository is available.
Diffstat (limited to 'src/software')
-rw-r--r-- | src/software/lmi/software/core/IdentityResource.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/software/lmi/software/core/IdentityResource.py b/src/software/lmi/software/core/IdentityResource.py index 0853442..6ef21f7 100644 --- a/src/software/lmi/software/core/IdentityResource.py +++ b/src/software/lmi/software/core/IdentityResource.py @@ -551,6 +551,7 @@ def _fill_non_keys(repo, model): Fills into the model of instance all non-key properties. """ model['AccessContext'] = Values.AccessContext.Other + access_info = None if repo.mirror_list: access_info = repo.mirror_list elif repo.base_urls: @@ -559,10 +560,9 @@ def _fill_non_keys(repo, model): LOG().warn('multiple base urls found for repository "%s",' ' selecting the last one', repo) access_info = repo.base_urls[-1] - else: - LOG().error('no base url found for repository "%s"', repo) - access_info = pywbem.CIMProperty('AccessInfo', - None, type='string') + if access_info is None: + LOG().error('no base url found for repository "%s"', repo) + access_info = pywbem.CIMProperty('AccessInfo', None, type='string') model["AccessInfo"] = access_info model['AvailableRequestedStates'] = [ Values.AvailableRequestedStates.Enabled, |