Skip to content

Commit

Permalink
fix: Replace all warn() with warning()
Browse files Browse the repository at this point in the history
* The warn() has been deprecated for very long time and it
  just become not available in the newest version of Python 3.13
  https://docs.python.org/3.13/whatsnew/3.13.html#logging
  • Loading branch information
jirihnidek committed Jul 1, 2024
1 parent 036ac99 commit 51cbe8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions virtwho/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def parse_file(filename):
except InvalidOption as e:
# When a configuration section has an Invalid Option, continue
# See https://bugzilla.redhat.com/show_bug.cgi?id=1457101 for more info
logger.warn("Invalid configuration detected: %s", str(e))
logger.warning("Invalid configuration detected: %s", str(e))
except DuplicateOptionError as e:
logger.warning(str(e))
except Exception as e:
Expand Down Expand Up @@ -1342,14 +1342,14 @@ def all_drop_dir_config_sections(config_dir=VW_CONF_DIR):
conf_files = set(s for s in all_dir_content if s.endswith('.conf'))
non_conf_files = all_dir_content - conf_files
except OSError:
logger.warn("Configuration directory '%s' doesn't exist or is not accessible",
logger.warning("Configuration directory '%s' doesn't exist or is not accessible",
config_dir)

Check failure on line 1346 in virtwho/config.py

View workflow job for this annotation

GitHub Actions / flake8 & rpmlint

E128 continuation line under-indented for visual indent
return {}

if not all_dir_content:
logger.warn("Configuration directory '%s' appears empty", config_dir)
logger.warning("Configuration directory '%s' appears empty", config_dir)
elif not conf_files:
logger.warn("Configuration directory '%s' does not have any '*.conf' files but "
logger.warning("Configuration directory '%s' does not have any '*.conf' files but "
"is not empty", config_dir)

Check failure on line 1353 in virtwho/config.py

View workflow job for this annotation

GitHub Actions / flake8 & rpmlint

E128 continuation line under-indented for visual indent
elif non_conf_files:
logger.debug("There are files in '%s' not ending in '*.conf' is this "
Expand All @@ -1372,7 +1372,7 @@ def has_config_files_in_drop_dir(config_dir=VW_CONF_DIR):
all_dir_content = set(os.listdir(config_dir))
conf_files = set(s for s in all_dir_content if s.endswith('.conf'))
except OSError:
logger.warn("Configuration directory '%s' doesn't exist or is not accessible",
logger.warning("Configuration directory '%s' doesn't exist or is not accessible",
config_dir)

Check failure on line 1376 in virtwho/config.py

View workflow job for this annotation

GitHub Actions / flake8 & rpmlint

E128 continuation line under-indented for visual indent
return False

Expand Down
2 changes: 1 addition & 1 deletion virtwho/manager/satellite/satellite.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def hypervisorCheckIn(self, report, options=None):
self.server_xmlrpc.registration.virt_notify(hypervisor_systemid["system_id"], plan)
except xmlrpc.client.Fault as e:
if e.faultCode == -9:
self.logger.warn("System was deleted from Satellite 5, reregistering")
self.logger.warning("System was deleted from Satellite 5, re-registering")
hypervisor_systemid = self._load_hypervisor(hypervisor.hypervisorId,
hypervisor_type=report.config['type'], force=True)
self.server_xmlrpc.registration.virt_notify(hypervisor_systemid["system_id"], plan)
Expand Down

0 comments on commit 51cbe8d

Please sign in to comment.