Skip to content

Commit

Permalink
Refactor: Update to using configparser
Browse files Browse the repository at this point in the history
Since we've effectively dropped Python2 support there is no reason to
keep using six for backwards compatibility. This is the first of many
small changes to remove six from use.

This one is first as newer mypy seems to be having issues with the
configparser transition!

Issue: RELENG-5063
Change-Id: If9cd83933d0cd6e0b7ac69afaa1bb94a9dab8202
Signed-off-by: Andrew Grimberg <[email protected]>
  • Loading branch information
tykeal committed Jan 8, 2024
1 parent 10213c4 commit 64d5714
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lftools/jenkins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

__author__ = "Thanh Ha"

import configparser
import logging
import os
from typing import Optional

import jenkins
from six.moves import configparser

log: logging.Logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -56,7 +56,7 @@ def __init__(
if "://" not in server:
if self.config_file:
log.debug("Using config from {}".format(self.config_file))
config: configparser.SafeConfigParser = configparser.SafeConfigParser()
config: configparser.ConfigParser = configparser.ConfigParser()
config.read(self.config_file)
if config.has_section(server):
user = config.get(server, "user")
Expand Down
7 changes: 7 additions & 0 deletions releasenotes/notes/remove_six-b89d618c51c3021a.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
deprecations:
- |
The six module is being phased out of use as Python 2 support has been
dropped. This release is the first in which one (or more) transitions have
happened. There should be no issues related to this transition but bugs may
creep in.

0 comments on commit 64d5714

Please sign in to comment.