@@ -221,7 +221,8 @@ def _create_fake_network_backup(self):
221221 _ctx .instance .runtime_properties ['resource_id' ] = 'resource'
222222 _ctx .instance .runtime_properties ['params' ] = {}
223223 _ctx .node .properties ['params' ] = {}
224- _ctx .instance .runtime_properties ["backups" ] = {"backup" : "<xml/>" }
224+ _ctx .instance .runtime_properties ["backups" ] = {
225+ "node_name-backup" : "<xml/>" }
225226 return _ctx , connect , network
226227
227228 def test_snapshot_apply (self ):
@@ -242,7 +243,7 @@ def test_snapshot_apply(self):
242243 ):
243244 with self .assertRaisesRegexp (
244245 NonRecoverableError ,
245- "No snapshots found with name: backup!."
246+ "No snapshots found with name: node_name- backup!."
246247 ):
247248 network_tasks .snapshot_apply (
248249 ctx = _ctx , snapshot_name = "backup!" ,
@@ -270,7 +271,7 @@ def test_snapshot_apply(self):
270271 ):
271272 with self .assertRaisesRegexp (
272273 NonRecoverableError ,
273- "No backups found with name: backup!."
274+ "No backups found with name: node_name- backup!."
274275 ):
275276 network_tasks .snapshot_apply (
276277 ctx = _ctx , snapshot_name = "backup!" ,
@@ -314,7 +315,7 @@ def test_snapshot_create(self):
314315 ):
315316 with self .assertRaisesRegexp (
316317 NonRecoverableError ,
317- "Snapshot backup already exists."
318+ "Snapshot node_name- backup already exists."
318319 ):
319320 network_tasks .snapshot_create (ctx = _ctx , snapshot_name = "backup" ,
320321 snapshot_incremental = True )
@@ -330,7 +331,7 @@ def test_snapshot_create(self):
330331 snapshot_incremental = True )
331332 self .assertEqual (
332333 _ctx .instance .runtime_properties ["backups" ],
333- {"backup" : "<network/>" })
334+ {"node_name- backup" : "<network/>" })
334335
335336 # check create snapshot
336337 with mock .patch (
@@ -353,7 +354,7 @@ def test_snapshot_create(self):
353354 ):
354355 with self .assertRaisesRegexp (
355356 NonRecoverableError ,
356- "Backup backup already exists."
357+ "Backup node_name- backup already exists."
357358 ):
358359 network_tasks .snapshot_create (
359360 ctx = _ctx , snapshot_name = "backup" ,
@@ -384,14 +385,14 @@ def test_snapshot_delete(self):
384385 ):
385386 with self .assertRaisesRegexp (
386387 NonRecoverableError ,
387- "No snapshots found with name: backup!."
388+ "No snapshots found with name: node_name- backup!."
388389 ):
389390 network_tasks .snapshot_delete (
390391 ctx = _ctx , snapshot_name = "backup!" ,
391392 snapshot_incremental = True )
392393 self .assertEqual (
393394 _ctx .instance .runtime_properties ["backups" ],
394- {" backup" : "<xml/>" })
395+ {'node_name- backup' : "<xml/>" })
395396
396397 # remove snapshot
397398 _ctx , connect , network = self ._create_fake_network_backup ()
@@ -415,7 +416,7 @@ def test_snapshot_delete(self):
415416 ):
416417 with self .assertRaisesRegexp (
417418 NonRecoverableError ,
418- "No backups found with name: backup!."
419+ "No backups found with name: node_name- backup!."
419420 ):
420421 network_tasks .snapshot_delete (
421422 ctx = _ctx , snapshot_name = "backup!" ,
@@ -458,7 +459,8 @@ def test_delete(self):
458459 # delete with error
459460 _ctx = self ._create_ctx ()
460461 _ctx .instance .runtime_properties ['resource_id' ] = 'resource'
461- _ctx .instance .runtime_properties ["backups" ] = {"backup" : "<xml/>" }
462+ _ctx .instance .runtime_properties ["backups" ] = {
463+ "node_name-backup" : "<xml/>" }
462464
463465 network = mock .Mock ()
464466 network .destroy = mock .Mock (return_value = - 1 )
0 commit comments