Skip to content
Snippets Groups Projects
Commit 092dc356 authored by Yas Naoi's avatar Yas Naoi
Browse files

Fixed - To avoid inserting duplicate entries in snapshot listinng - Added 'owner_id' check.

parent 864e162d
No related branches found
No related tags found
No related merge requests found
......@@ -134,12 +134,14 @@ function _aws_ec2_lib_download_describe_snapshots($cloud_context) {
) values
';
$count = 0 ;
$count = 0 ;
$owner_id = cloud_get_info($cloud_context , 'user_id');
foreach ($obj_response->snapshotSet->item as $item) {
$id = $item->snapshotId;
$exists = db_result(db_query("select snapshot_id from {" . $ec2_lib_snapshot_table . "} where snapshot_id = '%s'", array($id)));
if ($exists == FALSE) {
if ($exists == FALSE
&& $item->ownerId == $owner_id) {
$insert_query = $insert_query . " ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ," ;
$query_args[] = $item->snapshotId ;
$query_args[] = $cloud_context;
......@@ -170,7 +172,7 @@ function _aws_ec2_lib_download_describe_snapshots($cloud_context) {
$insert_query = substr($insert_query, 0, -1);
db_query( $insert_query, $query_args );
return TRUE;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment