Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute publisher count in the logging function #14

Merged
merged 1 commit into from
Sep 30, 2023

Conversation

indykoning
Copy link
Contributor

Currently when not all CNAMEs have been published we log a different message.
In the check we correctly execute the count function to get the count.
While logging the warning we have forgotten to do so, causing the following error.

restarting cname.py with /usr/src/app/cnames
starting cname.py
--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/logging/__init__.py", line 1083, in emit
    msg = self.format(record)
  File "/usr/local/lib/python3.9/logging/__init__.py", line 927, in format
    return fmt.format(record)
  File "/usr/local/lib/python3.9/logging/__init__.py", line 663, in format
    record.message = record.getMessage()
  File "/usr/local/lib/python3.9/logging/__init__.py", line 367, in getMessage
    msg = msg % self.args
TypeError: %d format: a number is required, not method
Call stack:
  File "/usr/src/app/cname.py", line 93, in <module>
    main()
  File "/usr/src/app/cname.py", line 88, in main
    log.warning("%d of %d published", publisher.count, len(cnames))
Message: '%d of %d published'
Arguments: (<bound method AvahiPublisher.count of <mpublisher.mpublisher.AvahiPublisher object at 0x7fb04e774760>>, 16)

@hardillb hardillb merged commit 83fa444 into hardillb:master Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants