diff options
author | Ville Heikkinen <ville.heikkinen@nokia.com> | 2019-02-13 09:37:47 +0200 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2019-03-04 16:43:27 +0000 |
commit | 96e614c13cca083ee55136f311171a1a2f4e2fc7 (patch) | |
tree | 78fe430c30511eb5a2e4ccd1dfd69c6e7ca05c46 | |
parent | bc34d9b938f9cd1c53120fc8badc3dff600771d3 (diff) | |
download | sos-96e614c13cca083ee55136f311171a1a2f4e2fc7.tar.gz |
[policies] Fix setting the custom name_pattern
Added initialization of date variable, so that it's possible to set the
custom name_pattern.
Without the fix, if the name_pattern is set in the plugin to be something
else than 'legacy' or 'friendly', the report generation will fail to
error
UnboundLocalError: local variable 'date' referenced before assignment
Resolves: #1570
Signed-off-by: Ville Heikkinen <ville.heikkinen@nokia.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/policies/__init__.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py index d0b18015..8d74caaf 100644 --- a/sos/policies/__init__.py +++ b/sos/policies/__init__.py @@ -509,6 +509,7 @@ No changes will be made to system configuration. name = self.get_local_name().split('.')[0] case = self.case_id label = self.commons['cmdlineopts'].label + date = '' rand = ''.join(random.choice(string.ascii_lowercase) for x in range(7)) if self.name_pattern == 'legacy': |