Skip to content

Commit

Permalink
Merge pull request ceph#24664 from tspmelo/wip-36513
Browse files Browse the repository at this point in the history
mgr/dashboard: Fix missing failed restore notification

Reviewed-by: Ricardo Marques <[email protected]>
Reviewed-by: Stephan Müller <[email protected]>
  • Loading branch information
LenzGr authored Oct 23, 2018
2 parents 80dd99b + 2f4ce95 commit 966a1e9
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export class RbdTrashRestoreModalComponent implements OnInit {
task: new FinishedTask('rbd/trash/restore', {
pool_name: this.poolName,
image_id: this.imageId,
image_name: this.imageName,
new_image_name: name
}),
call: this.rbdService.restoreTrash(this.poolName, this.imageId, name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,22 @@ describe('TaskManagerMessageService', () => {
});

describe('rbd tasks', () => {
let metadata;
let childMsg: string;
let destinationMsg: string;
let snapMsg: string;

beforeEach(() => {
const metadata = {
metadata = {
pool_name: 'somePool',
image_name: 'someImage',
snapshot_name: 'someSnapShot',
dest_pool_name: 'someDestinationPool',
dest_image_name: 'someDestinationImage',
child_pool_name: 'someChildPool',
child_image_name: 'someChildImage'
child_image_name: 'someChildImage',
new_image_name: 'newImage',
image_id: '12345'
};
defaultMsg = `RBD '${metadata.pool_name}/${metadata.image_name}'`;
childMsg = `RBD '${metadata.child_pool_name}/${metadata.child_image_name}'`;
Expand Down Expand Up @@ -172,6 +175,41 @@ describe('TaskManagerMessageService', () => {
finishedTask.name = 'rbd/snap/rollback';
testMessages(new TaskMessageOperation('Rolling back', 'rollback', 'Rolled back'), snapMsg);
});

it('tests rbd/trash/move messages', () => {
finishedTask.name = 'rbd/trash/move';
testMessages(
new TaskMessageOperation('Moving', 'move', 'Moved'),
`image '${metadata.pool_name}/${metadata.image_name}' to trash`
);
testErrorCode(2, `Could not find image.`);
});

it('tests rbd/trash/restore messages', () => {
finishedTask.name = 'rbd/trash/restore';
testMessages(
new TaskMessageOperation('Restoring', 'restore', 'Restored'),
`image '${metadata.pool_name}@${metadata.image_id}' \
into '${metadata.pool_name}/${metadata.new_image_name}'`
);
testErrorCode(
17,
`Image name '${metadata.pool_name}/${metadata.new_image_name}' is already in use.`
);
});

it('tests rbd/trash/remove messages', () => {
finishedTask.name = 'rbd/trash/remove';
testDelete(`image '${metadata.pool_name}/${metadata.image_name}@${metadata.image_id}'`);
});

it('tests rbd/trash/purge messages', () => {
finishedTask.name = 'rbd/trash/purge';
testMessages(
new TaskMessageOperation('Purging', 'purge', 'Purged'),
`images from '${metadata.pool_name}'`
);
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class TaskMessageService {
'rbd/trash/restore': new TaskMessage(
new TaskMessageOperation('Restoring', 'restore', 'Restored'),
(metadata) =>
`image '${metadata.pool_name}/${metadata.image_name}@${metadata.image_id}' \
`image '${metadata.pool_name}@${metadata.image_id}' \
into '${metadata.pool_name}/${metadata.new_image_name}'`,
(metadata) => ({
17: `Image name '${metadata.pool_name}/${metadata.new_image_name}' is already in use.`
Expand Down

0 comments on commit 966a1e9

Please sign in to comment.