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

Commit9727a98

Browse files
committed
PBCKP-422: Fix is_enterprise checking for upstream and pgpro. Add is_pgpro checking
1 parent3c11126 commit9727a98

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

‎tests/checkdb_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ def test_checkdb_with_least_privileges(self):
808808
"backupdb",
809809
"GRANT EXECUTE ON FUNCTION bt_index_check(regclass, bool, bool) TO backup")
810810

811-
ifProbackupTest.enterprise:
811+
ifProbackupTest.pgpro:
812812
node.safe_psql(
813813
'backupdb',
814814
'GRANT EXECUTE ON FUNCTION pg_catalog.pgpro_version() TO backup; '

‎tests/helpers/ptrack_helpers.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,27 +90,34 @@ def dir_files(base_dir):
9090
returnout_list
9191

9292

93+
defis_pgpro():
94+
# pg_config --help
95+
cmd= [os.environ['PG_CONFIG'],'--help']
96+
97+
result=subprocess.run(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,check=True)
98+
returnb'postgrespro'inresult.stdout
99+
100+
93101
defis_enterprise():
94102
# pg_config --help
95103
cmd= [os.environ['PG_CONFIG'],'--help']
96104

97-
p=subprocess.Popen(
98-
cmd,
99-
stdout=subprocess.PIPE,
100-
stderr=subprocess.PIPE
101-
)
102-
returnb'postgrespro.ru'inp.communicate()[0]
105+
p=subprocess.run(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,check=True)
106+
# PostgresPro std or ent
107+
ifb'postgrespro'inp.stdout:
108+
cmd= [os.environ['PG_CONFIG'],'--pgpro-edition']
109+
p=subprocess.run(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,check=True)
110+
111+
returnb'enterprise'inp.stdout
112+
else:# PostgreSQL
113+
returnFalse
114+
103115

104-
105116
defis_nls_enabled():
106117
cmd= [os.environ['PG_CONFIG'],'--configure']
107118

108-
p=subprocess.Popen(
109-
cmd,
110-
stdout=subprocess.PIPE,
111-
stderr=subprocess.PIPE
112-
)
113-
returnb'enable-nls'inp.communicate()[0]
119+
result=subprocess.run(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,check=True)
120+
returnb'enable-nls'inresult.stdout
114121

115122

116123
defbase36enc(number):
@@ -229,6 +236,7 @@ class ProbackupTest(object):
229236
# Class attributes
230237
enterprise=is_enterprise()
231238
enable_nls=is_nls_enabled()
239+
pgpro=is_pgpro()
232240

233241
def__init__(self,*args,**kwargs):
234242
super(ProbackupTest,self).__init__(*args,**kwargs)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp