[COMMIT scylla-cluster-tests master] fix(sct.py): pylint warnings

7 views
Skip to first unread message

Commit Bot

<bot@cloudius-systems.com>
unread,
Sep 27, 2021, 8:12:57 AM9/27/21
to scylladb-dev@googlegroups.com, Evgeniy Naydanov
From: Evgeniy Naydanov <evgeniy....@scylladb.com>
Committer: Bentsi <ben...@scylladb.com>
Branch: master

fix(sct.py): pylint warnings

sct.py:276:13: R1735: Consider using {} instead of dict() (use-dict-literal)
sct.py:666:24: W1310: Using formatting for a string that does not have any interpolated variables
(format-string-without-interpolation)
sct.py:815:19: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
sct.py:882:24: W1310: Using formatting for a string that does not have any interpolated variables
(format-string-without-interpolation)
sct.py:894:24: W1310: Using formatting for a string that does not have any interpolated variables
(format-string-without-interpolation)
sct.py:959:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)

---
diff --git a/sct.py b/sct.py
--- a/sct.py
+++ b/sct.py
@@ -239,7 +239,7 @@ def list_resources(ctx, user, test_id, get_all, get_all_running, verbose):

add_file_logger()

- params = dict()
+ params = {}

if user:
params['RunByUser'] = user
@@ -623,7 +623,7 @@ def perf_regression_report(es_id, emails):
send_email=True, email_recipients=email_list, logger=LOGGER)
click.secho(message="Checking regression comparing to: %s" % es_id, fg="green")
results_analyzer.check_regression(es_id)
- click.secho(message="Done." % email_list, fg="yellow")
+ click.secho(message="Done.", fg="yellow")


@click.group(help="Group of commands for investigating testrun")
@@ -772,7 +772,7 @@ def pre_commit():
class OutputLogger():
def __init__(self, filename, terminal):
self.terminal = terminal
- self.log = open(filename, "a") # pylint: disable=consider-using-with
+ self.log = open(filename, "a", encoding="utf-8") # pylint: disable=consider-using-with

def write(self, message):
self.terminal.write(message)
@@ -839,7 +839,7 @@ def cloud_usage_report(emails):
email_list = emails.split(",")
click.secho(message="Will send Cloud Usage report to %s" % email_list, fg="green")
cloud_report(mail_to=email_list)
- click.secho(message="Done." % email_list, fg="yellow")
+ click.secho(message="Done.", fg="yellow")


@cli.command("cloud-usage-qa-report", help="Generate and send Cloud usage report")
@@ -851,7 +851,7 @@ def cloud_usage_qa_report(emails, user=None):
email_list = emails.split(",")
click.secho(message="Will send Cloud Usage report to %s" % email_list, fg="green")
cloud_qa_report(mail_to=email_list, user=user)
- click.secho(message="Done." % email_list, fg="yellow")
+ click.secho(message="Done.", fg="yellow")


@cli.command('collect-logs', help='Collect logs from cluster by test-id')
@@ -916,7 +916,7 @@ def send_email(test_id=None, test_status=None, start_time=None, started_by=None,
start_time = format_timestamp(int(start_time))
testrun_dir = get_testrun_dir(test_id=test_id, base_dir=logdir)
if testrun_dir:
- with open(os.path.join(testrun_dir, 'test_id'), 'r') as file:
+ with open(os.path.join(testrun_dir, 'test_id'), 'r', encoding='utf-8') as file:
test_id = file.read().strip()
email_results_file = os.path.join(testrun_dir, "email_data.json")
test_results = read_email_data_from_file(email_results_file)
Reply all
Reply to author
Forward
0 new messages