-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Hello,
If I understand correctly, ProbackupTest::backup_node allows node==None when data_dir is defined (see line 1098).
On the other side, this method always calls node.port (line 1110) and this is supposes that node is valid (not None).
pg_probackup/tests/helpers/ptrack_helpers.py
Lines 1091 to 1112 in a2510f5
def backup_node( | |
self, backup_dir, instance, node, data_dir=False, | |
backup_type='full', datname=False, options=[], | |
asynchronous=False, gdb=False, | |
old_binary=False, return_id=True, no_remote=False, | |
env=None | |
): | |
if not node and not data_dir: | |
print('You must provide ether node or data_dir for backup') | |
exit(1) | |
if not datname: | |
datname = 'postgres' | |
cmd_list = [ | |
'backup', | |
'-B', backup_dir, | |
'--instance={0}'.format(instance), | |
# "-D", pgdata, | |
'-p', '%i' % node.port, | |
'-d', datname | |
] |
I used a debugger to set None in node to "<some string>" in data_dir.
Expression if not node and not data_dir:
said OK, but a test was finished with the following error:
cmd_list = [
'backup',
'-B', backup_dir,
'--instance={0}'.format(instance),
# "-D", pgdata,
> '-p', '%i' % node.port,
'-d', datname
]
E AttributeError: 'NoneType' object has no attribute 'port'
tests/helpers/ptrack_helpers.py:1110: AttributeError
Metadata
Metadata
Assignees
Labels
No labels