Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit48f9892

Browse files
author
vshepard
committed
fix flake8 problems
1 parent204746d commit48f9892

File tree

3 files changed

+18
-25
lines changed

3 files changed

+18
-25
lines changed

‎testgres/plugins/probackup/app.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,12 @@ def run(self, command, gdb=False, old_binary=False, return_id=True, env=None,
132132
definit(self,options=None,old_binary=False,skip_log_directory=False,expect_error=False,use_backup_dir=True):
133133
ifoptionsisNone:
134134
options= []
135-
returnself.run([
136-
'init',
137-
]+options,
138-
old_binary=old_binary,
139-
skip_log_directory=skip_log_directory,
140-
expect_error=expect_error,
141-
use_backup_dir=use_backup_dir
142-
)
135+
returnself.run(['init', ]+options,
136+
old_binary=old_binary,
137+
skip_log_directory=skip_log_directory,
138+
expect_error=expect_error,
139+
use_backup_dir=use_backup_dir
140+
)
143141

144142
defadd_instance(self,instance,node,old_binary=False,options=None,expect_error=False):
145143
ifoptionsisNone:
@@ -535,7 +533,6 @@ def show_archive(
535533
break
536534

537535
iftli>0:
538-
timeline_data=None
539536
fortimelineininstance_timelines:
540537
iftimeline['tli']==tli:
541538
returntimeline
@@ -664,7 +661,7 @@ def set_archiving(
664661
archive_command+=' --remote-proto=ssh --remote-host=localhost'
665662

666663
ifinit_params.archive_compressandcompress:
667-
archive_command+=' --compress-algorithm='+init_params.archive_compress
664+
archive_command+=' --compress-algorithm='+init_params.archive_compress
668665

669666
ifoverwrite:
670667
archive_command+=' --overwrite'

‎testgres/plugins/probackup/gdb.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,7 @@ def continue_execution_until_exit(self):
191191
continue
192192
ifline.startswith('*stopped,reason="breakpoint-hit"'):
193193
continue
194-
if (
195-
line.startswith('*stopped,reason="exited')or
196-
line=='*stopped\n'
197-
):
194+
ifline.startswith('*stopped,reason="exited')orline=='*stopped\n':
198195
self.quit()
199196
return
200197

‎testgres/plugins/probackup/init_helpers.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88
importtestgres
99

1010
try:
11-
importlz4.frame
11+
importlz4.frame# noqa: F401
12+
1213
HAVE_LZ4=True
1314
exceptImportErrorase:
1415
HAVE_LZ4=False
1516
LZ4_error=e
1617

1718
try:
18-
importzstd
19+
importzstd# noqa: F401
20+
1921
HAVE_ZSTD=True
2022
exceptImportErrorase:
2123
HAVE_ZSTD=False
@@ -28,8 +30,8 @@
2830
cache_initdb=False,
2931
cached_initdb_dir=False,
3032
node_cleanup_full=delete_logs)
31-
except:
32-
pass
33+
exceptExceptionase:
34+
print("Can't configure testgres: {0}".format(e))
3335

3436

3537
classInit(object):
@@ -46,7 +48,7 @@ def __init__(self):
4648
version=self._pg_config['VERSION'].rstrip('develalphabetapre')
4749
parts= [*version.split(' ')[1].split('.'),'0','0'][:3]
4850
parts[0]=re.match(r'\d+',parts[0]).group()
49-
self.pg_config_version=reduce(lambdav,x:v*100+int(x),parts,0)
51+
self.pg_config_version=reduce(lambdav,x:v*100+int(x),parts,0)
5052

5153
test_env=os.environ.copy()
5254
envs_list= [
@@ -133,10 +135,7 @@ def __init__(self):
133135

134136
self.probackup_old_path=None
135137
if'PGPROBACKUPBIN_OLD'intest_env:
136-
if (
137-
os.path.isfile(test_env['PGPROBACKUPBIN_OLD'])and
138-
os.access(test_env['PGPROBACKUPBIN_OLD'],os.X_OK)
139-
):
138+
if (os.path.isfile(test_env['PGPROBACKUPBIN_OLD'])andos.access(test_env['PGPROBACKUPBIN_OLD'],os.X_OK)):
140139
self.probackup_old_path=test_env['PGPROBACKUPBIN_OLD']
141140
else:
142141
ifself.verbose:
@@ -166,8 +165,7 @@ def __init__(self):
166165
).group(0)
167166

168167
self.remote=test_env.get('PGPROBACKUP_SSH_REMOTE',None)=='ON'
169-
self.ptrack=test_env.get('PG_PROBACKUP_PTRACK',None)=='ON'and \
170-
self.pg_config_version>=110000
168+
self.ptrack=test_env.get('PG_PROBACKUP_PTRACK',None)=='ON'andself.pg_config_version>=110000
171169

172170
self.paranoia=test_env.get('PG_PROBACKUP_PARANOIA',None)=='ON'
173171
env_compress=test_env.get('ARCHIVE_COMPRESSION',None)
@@ -200,4 +198,5 @@ def __init__(self):
200198
deftest_env(self):
201199
returnself._test_env.copy()
202200

201+
203202
init_params=Init()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp