Skip to content

Commit

Permalink
Merge pull request #21 from orange-kao/orange-use-fixed-pylint-version
Browse files Browse the repository at this point in the history
Fix CI - pylint
  • Loading branch information
facetoe authored Nov 3, 2021
2 parents eac6e9b + 6cfb8d1 commit 4a08cdb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ disable=
line-too-long,
no-else-continue,
no-else-break,
import-outside-toplevel
import-outside-toplevel,
unspecified-encoding

[FORMAT]
max-line-length=125
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ all:
PYTHON ?= python3
PYTHON_SOURCE_DIRS = rpm_s3_mirror/ tests/
PYTEST_ARG ?= -v
PYLINT=$(shell which pylint 2> /dev/null | which pylint-3)
PYLINT=$(shell which pylint 2> /dev/null || which pylint-3)

clean:
$(RM) -r *.egg-info/ build/ dist/ rpm/
Expand Down
2 changes: 1 addition & 1 deletion rpm_s3_mirror/mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _sync_repository(self, upstream_repository):
upstream_metadata = upstream_repository.parse_metadata()

mirror_repository = RPMRepository(base_url=self._build_s3_url(upstream_repository.base_url))
bootstrap = False if mirror_repository.exists() else True
bootstrap = not mirror_repository.exists()
if bootstrap:
self.log.info("Bootstrapping repository: %s", upstream_repository.base_url)
new_packages = upstream_metadata.package_list
Expand Down
2 changes: 1 addition & 1 deletion rpm_s3_mirror/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def parse_repomd(self, xml: Element) -> Dict[str, RepodataSection]:
return sections

def _req(self, method, path, *, json=None, params=None, acceptible_status_code=None, **kwargs) -> Response:
acceptible_status_code = acceptible_status_code if acceptible_status_code else {200}
acceptible_status_code = acceptible_status_code or {200}
url = f"{self.base_url}{path}"
response = method(url, json=json, params=params, **kwargs)
if response.status_code not in acceptible_status_code:
Expand Down
2 changes: 1 addition & 1 deletion rpm_s3_mirror/statsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ def _send(self, metric, metric_type, value, tags):
parts.append(pattern.format(separator, tag, val).encode("utf-8"))
else:
for tag, val in send_tags.items():
parts.insert(1, ",{}={}".format(tag, val).encode("utf-8"))
parts.insert(1, f",{tag}={val}".encode("utf-8"))

self._socket.sendto(b"".join(parts), self._dest_addr)

0 comments on commit 4a08cdb

Please sign in to comment.