Set the with_strategy_settings to None for unknown backups (#133466)

This commit is contained in:
Erik Montnemery 2024-12-18 11:27:07 +01:00 committed by GitHub
parent 7730f423b3
commit 992afc4cd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 30 additions and 30 deletions

View File

@ -60,7 +60,7 @@ class ManagerBackup(AgentBackup):
agent_ids: list[str]
failed_agent_ids: list[str]
with_strategy_settings: bool
with_strategy_settings: bool | None
@dataclass(frozen=True, kw_only=True, slots=True)
@ -448,7 +448,7 @@ class BackupManager:
with_strategy_settings = known_backup.with_strategy_settings
else:
failed_agent_ids = []
with_strategy_settings = False
with_strategy_settings = None
backups[backup_id] = ManagerBackup(
agent_ids=[],
addons=agent_backup.addons,
@ -497,7 +497,7 @@ class BackupManager:
with_strategy_settings = known_backup.with_strategy_settings
else:
failed_agent_ids = []
with_strategy_settings = False
with_strategy_settings = None
backup = ManagerBackup(
agent_ids=[],
addons=result.addons,

View File

@ -78,7 +78,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,

View File

@ -1539,7 +1539,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -1607,7 +1607,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -1660,7 +1660,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -1697,7 +1697,7 @@
'name': 'Test 2',
'protected': False,
'size': 1,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -1745,7 +1745,7 @@
'name': 'Test 2',
'protected': False,
'size': 1,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -1788,7 +1788,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -1841,7 +1841,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -1895,7 +1895,7 @@
'name': 'Test',
'protected': False,
'size': 13,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -2003,7 +2003,7 @@
'name': 'Test',
'protected': False,
'size': 13,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -2056,7 +2056,7 @@
'name': 'Test',
'protected': False,
'size': 13,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -2109,7 +2109,7 @@
'name': 'Test',
'protected': False,
'size': 13,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -2216,7 +2216,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
}),
'success': True,
@ -2254,7 +2254,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
}),
'success': True,
@ -2305,7 +2305,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
}),
'success': True,
@ -2344,7 +2344,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
}),
'success': True,
@ -2607,7 +2607,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -2649,7 +2649,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -2692,7 +2692,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -2729,7 +2729,7 @@
'name': 'Test 2',
'protected': False,
'size': 1,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
dict({
'addons': list([
@ -2756,7 +2756,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,
@ -2799,7 +2799,7 @@
'name': 'Test',
'protected': False,
'size': 0,
'with_strategy_settings': False,
'with_strategy_settings': None,
}),
]),
'last_attempted_strategy_backup': None,

View File

@ -171,7 +171,7 @@ async def test_agents_list_backups(
"size": 34519040,
"agent_ids": ["cloud.cloud"],
"failed_agent_ids": [],
"with_strategy_settings": False,
"with_strategy_settings": None,
}
]
@ -218,7 +218,7 @@ async def test_agents_list_backups_fail_cloud(
"size": 34519040,
"agent_ids": ["cloud.cloud"],
"failed_agent_ids": [],
"with_strategy_settings": False,
"with_strategy_settings": None,
},
),
(

View File

@ -341,7 +341,7 @@ async def test_agent_info(
"name": "Test",
"protected": False,
"size": 1048576,
"with_strategy_settings": False,
"with_strategy_settings": None,
},
),
(
@ -362,7 +362,7 @@ async def test_agent_info(
"name": "Test",
"protected": False,
"size": 1048576,
"with_strategy_settings": False,
"with_strategy_settings": None,
},
),
],

View File

@ -104,7 +104,7 @@ async def test_agents_list_backups(
"name": "Kitchen sink syncer",
"protected": False,
"size": 1234,
"with_strategy_settings": False,
"with_strategy_settings": None,
}
]