Skip to content

Commit

Permalink
Fix naming from leftover #82 PR (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
r0x0d authored Apr 24, 2024
1 parent 2db4c86 commit a267e65
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,10 @@ pre-commit:

install: install-deps pre-commit

tests: install-deps
. $(PYTHON_VENV)/bin/activate; \
$(PYTEST_CALL)

sync: install-deps
. $(PYTHON_VENV)/bin/activate; \
python misc/sync_scripts.py

image7: .build-image7

.fetch-image7:
@echo "Pulling $(IMAGE)-centos7"
@$(PODMAN) pull $(IMAGE)-centos7
Expand Down
10 changes: 5 additions & 5 deletions scripts/c2r_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@
LATEST_YUM_TRANSACTION_PATTERN = re.compile(r"^(\s+)?(\d+)", re.MULTILINE)

# Path to store the script logs
LOG_DIR = "/var/log/convert2rhel-worker-scripts"
LOG_DIR = "/var/log/convert2rhel-insights-tasks"
# Log filename for the script. It will be created based on the script type of
# execution.
LOG_FILENAME = "convert2rhel-worker-script-%s.log" % (
LOG_FILENAME = "convert2rhel-insights-tasks-%s.log" % (
"conversion" if IS_CONVERSION else "analysis"
)

# Path to the sos extras folder
SOS_REPORT_FOLDER = "/etc/sos.extras.d"
# Name of the file based on the conversion type for sos report
SOS_REPORT_FILE = "convert2rhel-worker-scripts-%s-logs" % (
SOS_REPORT_FILE = "convert2rhel-insights-tasks-%s-logs" % (
"conversion" if IS_CONVERSION else "analysis"
)

Expand Down Expand Up @@ -245,8 +245,8 @@ def archive_old_logger_files():
the same name for the log file, but having an appended timestamp to it.
For example:
/var/log/convert2rhel-worker-scripts/archive/convert2rhel-worker-scripts-1635162445070567607.log
/var/log/convert2rhel-worker-scripts/archive/convert2rhel-worker-scripts-1635162478219820043.log
/var/log/convert2rhel-insights-tasks/archive/convert2rhel-insights-tasks-1635162445070567607.log
/var/log/convert2rhel-insights-tasks/archive/convert2rhel-insights-tasks-1635162478219820043.log
This way, the user can track the logs for each run individually based on
the timestamp.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ def test_setup_sos_report(monkeypatch, tmpdir):
setup_sos_report()

sos_report_file = os.path.join(
sos_report_folder, "convert2rhel-worker-scripts-analysis-logs"
sos_report_folder, "convert2rhel-insights-tasks-analysis-logs"
)
assert os.path.exists(sos_report_folder)
assert os.path.exists(sos_report_file)

with open(sos_report_file) as handler:
assert (
":/var/log/convert2rhel-worker-scripts/convert2rhel-worker-script-analysis.log"
":/var/log/convert2rhel-insights-tasks/convert2rhel-insights-tasks-analysis.log"
== handler.read().strip()
)

Expand Down

0 comments on commit a267e65

Please sign in to comment.